List Commands plugin by "Thijs Kinkhorst" <thijs@kinkhorst.com>
[squirrelmail.git] / functions / imap_general.php
index a2e6bac355d36b2816f8ac11d099dc7a05364ac2..81c0d9429998b89a82b6571053aa59df5960aac7 100755 (executable)
@@ -354,7 +354,7 @@ function sqimap_find_email ($string) {
  *    Luke Ehresman   <lkehresman@yahoo.com>
  *    "Luke Ehresman" <lkehresman@yahoo.com>
  *    lkehresman@yahoo.com (Luke Ehresman)
- *           become:   Luke Ehresman
+ *           becomes:   Luke Ehresman
  *    <lkehresman@yahoo.com>
  *           becomes:   lkehresman@yahoo.com
  */
@@ -363,6 +363,9 @@ function sqimap_find_displayable_name ($string) {
     
     if ( ereg('^(.+)<.*>', $string, $regs) ) {
         $string = ereg_replace ('"', '', $regs[1] );
+        if( $string == '' || $string == ' ' ){
+            $string = '&nbsp';
+        }
     }
     elseif ( ereg('\((.*)\)', $string, $regs) ) {
         if( ( $regs[1] == '' ) || ( $regs[1] == ' ' ) ){
@@ -387,7 +390,7 @@ function sqimap_find_displayable_name ($string) {
 */
 function sqimap_unseen_messages ($imap_stream, $mailbox) {
     //fputs ($imap_stream, sqimap_session_id() . " SEARCH UNSEEN NOT DELETED\r\n");
-    $read_ary = sqimap_run_command ($imap_stream, " STATUS \"$mailbox\" (UNSEEN)", true, $result, $message);
+    $read_ary = sqimap_run_command ($imap_stream, "STATUS \"$mailbox\" (UNSEEN)", true, $result, $message);
     ereg("UNSEEN ([0-9]+)", $read_ary[0], $regs);
     return $regs[1];
 }