From a97105e6398ca338deaf86cec5a5098ea9ad46c6 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Wed, 6 Dec 2000 15:35:30 +0000 Subject: [PATCH] - added patch to fix bugs with renaming folders git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@871 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/folders_rename_do.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/folders_rename_do.php b/src/folders_rename_do.php index 549f2c13..07438e10 100644 --- a/src/folders_rename_do.php +++ b/src/folders_rename_do.php @@ -50,16 +50,20 @@ sqimap_unsubscribe($imapConnection, $orig); sqimap_subscribe($imapConnection, $newone); - fputs ($imapConnection, "a001 LSUB \"\" \"$orig*\"\r\n"); + fputs ($imapConnection, "a001 LIST \"\" \"$newone*\"\r\n"); $data = sqimap_read_data($imapConnection, "a001", true, $a, $b); - for ($i=0; $i < count($data); $i++) { + for ($i=0; $i < count($data); $i++) + { $name = find_mailbox_name($data[$i]); - sqimap_unsubscribe($imapConnection, $name); - $name = substr($name, strlen($orig)); - $name = $newone . $name; - sqimap_subscribe($imapConnection, $name); - } + if ($name != $newone) # don't try to resubscribe when renaming ab to abc + { + sqimap_unsubscribe($imapConnection, $name); + $name = substr($name, strlen($orig)); + $name = $newone . $name; + sqimap_subscribe($imapConnection, $name); + } + } /** Log out this session **/ sqimap_logout($imapConnection); -- 2.25.1