Ver código fonte

Found this stuff when trying to figure out why I couldn't name a folder
"Humor / Jokes"
Turns out that this didn't quote any folder names, and the '/' is an illegal
folder name character. Any ideas about the '/'? (Might be Courier specific)

Tyler Akins 24 anos atrás
pai
commit
88bed3e140
1 arquivos alterados com 7 adições e 3 exclusões
  1. 7 3
      src/folders_rename_do.php

+ 7 - 3
src/folders_rename_do.php

@@ -34,8 +34,11 @@
    else
       $newone = "$new_name";
 
-   fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\r\n");
-   $data = sqimap_read_data($imapConnection, ".", true, $a, $b);
+   $cmd = "a024 RENAME \"" . quoteIMAP($orig) . "\" \"" .
+      quoteIMAP($newone) . "\"\r\n";
+   echo htmlspecialchars($cmd) . "<br>\n";
+   fputs ($imapConnection, $cmd);
+   $data = sqimap_read_data($imapConnection, "a024", true, $a, $b);
 
    // Renaming a folder doesn't renames the folder but leaves you unsubscribed
    //    at least on Cyrus IMAP servers.
@@ -46,7 +49,8 @@
    sqimap_unsubscribe($imapConnection, $orig);
    sqimap_subscribe($imapConnection, $newone);
 
-	fputs ($imapConnection, "a001 LIST \"\" \"$newone*\"\r\n");
+   fputs ($imapConnection, "a001 LIST \"\" \"" . quoteIMAP($newone) .
+      "*\"\r\n");
    $data = sqimap_read_data($imapConnection, "a001", true, $a, $b);
    for ($i=0; $i < count($data); $i++)
    {