X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffolders.php;h=7e4966eeba582d437c50f5c709e29b972a0eac4c;hb=8f6f9ba5df6491d396aa690dcf3e5b9070a565ca;hp=63b4ac221eb9cfd6bba1ce097791a902c95b9b88;hpb=6e2ae2646b4ce2fce87dabc760ebf71e47aaa3d2;p=squirrelmail.git
diff --git a/src/folders.php b/src/folders.php
index 63b4ac22..7e4966ee 100644
--- a/src/folders.php
+++ b/src/folders.php
@@ -11,9 +11,10 @@
* Folders.
*
* $Id$
+ * @package squirrelmail
*/
-/* Path for SquirrelMail required files. */
+/** Path for SquirrelMail required files. */
define('SM_PATH','../');
/* SquirrelMail required files. */
@@ -101,12 +102,11 @@ echo html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="4" cellspaci
'
'.
"\n";
if ($show_contain_subfolders_option) {
@@ -139,29 +139,49 @@ echo html_tag( 'tr',
) ."\n";
/** count special folders **/
+
+// FIX ME, why not check if the folders are defined IMHO move_to_sent, move_to_trash has nothing todo with it
$count_special_folders = 0;
$num_max = 1;
if (strtolower($imap_server_type) == "courier" || $move_to_trash) {
- $num_max++;
+ $num_max++;
}
if ($move_to_sent) {
- $num_max++;
+ $num_max++;
}
if ($save_as_draft) {
- $num_max++;
+ $num_max++;
}
+
+// What if move_to_sent = false and $sent_folder is set? Should it still be skipped?
+
for ($p = 0, $cnt = count($boxes); $p < $cnt && $count_special_folders < $num_max; $p++) {
- if (strtolower($boxes[$p]['unformatted']) == 'inbox')
- $count_special_folders++;
- else if (strtolower($imap_server_type) == 'courier' &&
- strtolower($boxes[$p]['unformatted']) == 'inbox.trash')
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $trash_folder && $trash_folder)
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $sent_folder && $sent_folder)
- $count_special_folders++;
- else if ($boxes[$p]['unformatted'] == $draft_folder && $draft_folder)
- $count_special_folders++;
+ switch ($boxes[$p]['unformatted'])
+ {
+ case (strtoupper($boxes[$p]['unformatted']) == 'INBOX'):
+ ++$count_special_folders;
+ $skip_folders[] = $boxes[$p]['unformatted'];
+ break;
+ // FIX ME inbox.trash should be set in conf.pl
+ case 'inbox.trash':
+ if (strtolower($imap_server_type) == 'courier') {
+ ++$count_special_folders;
+ }
+ break;
+ case $trash_folder:
+ ++$count_special_folders;
+ $skip_folders[] = $trash_folder;
+ break;
+ case $sent_folder:
+ ++$count_special_folders;
+ $skip_folders[] = $sent_folder;
+ break;
+ case $draft_folder:
+ ++$count_special_folders;
+ $skip_folders[] = $draft_folder;
+ break;
+ default: break;
+ }
}
@@ -177,7 +197,11 @@ if ($count_special_folders < count($boxes)) {
. "\n".
"\n"
. '$box2\n";
}
}
@@ -272,8 +298,8 @@ if(!$no_list_for_subscribe) {
}
}
if ($use_folder == true) {
- $box[$q] = $boxes_all[$i]['unformatted-dm'];
- $box2[$q] = imap_utf7_decode_local($boxes_all[$i]['unformatted-disp']);
+ $box[$q] = htmlspecialchars($boxes_all[$i]['unformatted-dm']);
+ $box2[$q] = htmlspecialchars(imap_utf7_decode_local($boxes_all[$i]['unformatted-disp']));
$q++;
}
}