Remove unnecessary mailbox name escaping
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 29 May 2009 05:22:24 +0000 (23:22 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 29 May 2009 20:05:39 +0000 (14:05 -0600)
imp/folders.php
imp/lib/Imap/Tree.php

index 3a5b689..334018d 100644 (file)
@@ -351,8 +351,13 @@ if ($_SESSION['imp']['file_upload'] && ($actionID == 'import_mbox')) {
 }
 
 /* Build the folder tree. */
-list($raw_rows, $newmsgs, $displayNames) = $imaptree->build();
+list($raw_rows, $newmsgs) = $imaptree->build();
 
+/* Build the list of display names. */
+reset($raw_rows);
+while (list(,$r) = each($raw_rows)) {
+    $displayNames[] = $r['display'];
+}
 IMP::addInlineScript(array(
     'ImpFolders.displayNames = ' . Horde_Serialize::serialize($displayNames, Horde_Serialize::JSON, $charset)
 ));
index 09e251b..38f376d 100644 (file)
@@ -1586,9 +1586,8 @@ class IMP_Imap_Tree
      *                       different icon whether the folder is opened or
      *                       closed.
      *
-     * @return array  An array with three elements: the folder list, the total
-     *                number of new messages, and a list with folder names
-     *                suitable for user interaction.
+     * @return array  An array with two elements: the folder list and the
+     *                total number of new messages.
      *                The folder list array contains the following added
      *                entries on top of the entries provided by element():
      * <pre>
@@ -1598,7 +1597,7 @@ class IMP_Imap_Tree
      */
     public function build($mask = 0, $open = true)
     {
-        $displayNames = $newmsgs = $rows = array();
+        $newmsgs = $rows = array();
         $this->_forceopen = $open;
 
         /* Start iterating through the list of mailboxes, displaying them. */
@@ -1616,13 +1615,12 @@ class IMP_Imap_Tree
             /* Hide folder prefixes from the user. */
             if ($row['level'] >= 0) {
                 $rows[] = $row;
-                $displayNames[] = addslashes($row['display']);
             }
         } while (($mailbox = $this->next($mask)));
 
         $this->_forceopen = false;
 
-        return array($rows, $newmsgs, $displayNames);
+        return array($rows, $newmsgs);
     }
 
     /**