Browse Source

Fixed bug where str_repeat was called with 0 as multiplier. Simple "if"
statement around the command. :-)

Tyler Akins 24 years ago
parent
commit
92713996cf
1 changed files with 8 additions and 2 deletions
  1. 8 2
      functions/imap_mailbox.php

+ 8 - 2
functions/imap_mailbox.php

@@ -144,7 +144,10 @@
 	    (ereg("^".$folder_prefix, $mailbox)) ||
             ( isset($boxesbyname[$parentfolder]) && (strlen($parentfolder) > 0) ) ) {
             $indent = $dm_count - (countCharInString($folder_prefix, $dm));
-            $boxes[$g]["formatted"]  = str_repeat("  ", $indent);
+            if ($indent)
+                $boxes[$g]["formatted"]  = str_repeat("  ", $indent);
+            else
+                $boxes[$g]["formatted"] = '';
             $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
          } else {
             $boxes[$g]["formatted"]  = $mailbox;
@@ -333,7 +336,10 @@
             if((eregi("^inbox".quotemeta($dm), $mailbox)) || 
                (ereg("^".$folder_prefix, $mailbox)) ||
                ( isset($boxesbyname[$parentfolder]) && (strlen($parentfolder) > 0) ) ) {
-               $boxes[$g]["formatted"]  = str_repeat("  ", $dm_count);
+               if ($dm_count)
+                   $boxes[$g]["formatted"]  = str_repeat("  ", $dm_count);
+               else
+                   $boxes[$g]["formatted"] = '';
                $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
             } else {
                $boxes[$g]["formatted"]  = $mailbox;