X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders.php;h=73aa9eced00f28c73d57b399fa7ba5cbe64275ff;hb=6c540963c77709619a0670cc733249c8a4162c30;hp=182a1d3cb2e50bd32b4998c7fab75bd92815451f;hpb=f38b7cf06c3343a7fead417d90bd67d291f5dc29;p=squirrelmail.git
diff --git a/src/folders.php b/src/folders.php
index 182a1d3c..73aa9ece 100644
--- a/src/folders.php
+++ b/src/folders.php
@@ -101,12 +101,11 @@ echo html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="4" cellspaci
'
'.
"\n";
if ($show_contain_subfolders_option) {
@@ -135,29 +138,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;
+ }
}
@@ -173,7 +196,11 @@ if ($count_special_folders < count($boxes)) {
. "\n".
"\n"
. '$box2\n";
}
}
@@ -268,8 +297,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++;
}
}