Found this stuff when trying to figure out why I couldn't name a folder
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 25 Jun 2001 17:32:08 +0000 (17:32 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 25 Jun 2001 17:32:08 +0000 (17:32 +0000)
"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)

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

src/folders_rename_do.php

index 99324ca09170d7b97012bc2bef304c18edb9a7dd..da76944a50bc8551e0af976208f2afcb028c6d7a 100644 (file)
    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++)
    {