Fixed bug where str_repeat was called with 0 as multiplier. Simple "if"
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 13 Dec 2000 23:38:03 +0000 (23:38 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 13 Dec 2000 23:38:03 +0000 (23:38 +0000)
statement around the command.  :-)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@885 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php

index 21ee5a8..ed043c7 100755 (executable)
            (ereg("^".$folder_prefix, $mailbox)) ||
             ( isset($boxesbyname[$parentfolder]) && (strlen($parentfolder) > 0) ) ) {
             $indent = $dm_count - (countCharInString($folder_prefix, $dm));
-            $boxes[$g]["formatted"]  = str_repeat("&nbsp;&nbsp;", $indent);
+            if ($indent)
+                $boxes[$g]["formatted"]  = str_repeat("&nbsp;&nbsp;", $indent);
+            else
+                $boxes[$g]["formatted"] = '';
             $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
          } else {
             $boxes[$g]["formatted"]  = $mailbox;
             if((eregi("^inbox".quotemeta($dm), $mailbox)) || 
                (ereg("^".$folder_prefix, $mailbox)) ||
                ( isset($boxesbyname[$parentfolder]) && (strlen($parentfolder) > 0) ) ) {
-               $boxes[$g]["formatted"]  = str_repeat("&nbsp;&nbsp;", $dm_count);
+               if ($dm_count)
+                   $boxes[$g]["formatted"]  = str_repeat("&nbsp;&nbsp;", $dm_count);
+               else
+                   $boxes[$g]["formatted"] = '';
                $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
             } else {
                $boxes[$g]["formatted"]  = $mailbox;