X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Ffilters%2Fspamoptions.php;h=1026e755895a06a5771030c838e0dcbd95e8ed67;hb=2600c421b6171602417f39d2751da9f7799fe01d;hp=4e0832defc5e74ae1689a4c43f49cc2c697ad347;hpb=08185f2a7631c3a12cb1ac085fec3be471b56b00;p=squirrelmail.git
diff --git a/plugins/filters/spamoptions.php b/plugins/filters/spamoptions.php
index 4e0832de..1026e755 100644
--- a/plugins/filters/spamoptions.php
+++ b/plugins/filters/spamoptions.php
@@ -1,52 +1,55 @@
$Value) {
$input = $spam_filters[$Key]['prefname'] . '_set';
- if ( isset( $$input ) ) {
- setPref( $data_dir, $username, $spam_filters[$Key]['prefname'],
- $$input);
+ if ( sqgetGlobalVar($input,$input_key,SQ_POST) ) {
+ setPref( $data_dir, $username, $spam_filters[$Key]['prefname'],$input_key);
} else {
removePref($data_dir, $username, $spam_filters[$Key]['prefname']);
}
@@ -64,47 +67,41 @@ echo html_tag( 'table',
'center', $color[0], 'width="95%" border="0" cellpadding="2" cellspacing="0"' );
if ($SpamFilters_YourHop == ' ') {
- echo '
' .
+ echo '
' .
html_tag( 'div', '' .
- _("WARNING! Tell your admin to set the SpamFilters_YourHop variable") .
+ sprintf(_("WARNING! Tell the administrator to set the %s variable."), '"SpamFilters_YourHop"') .
'' ,
'center' ) .
- '
';
+ '
';
}
if (isset($action) && $action == 'spam') {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
sqimap_logout($imapConnection);
- for ($i = 0; $i < count($boxes) && $filters_spam_folder == ''; $i++) {
+ $numboxes = count($boxes);
- if ($boxes[$i]['flags'][0] != 'noselect' &&
- $boxes[$i]['flags'][1] != 'noselect' &&
- $boxes[$i]['flags'][2] != 'noselect') {
+ for ($i = 0; $i < $numboxes && $filters_spam_folder == ''; $i++) {
+ if ((isset($boxes[$i]['flags'][0]) && $boxes[$i]['flags'][0] != 'noselect') &&
+ (isset($boxes[$i]['flags'][1]) && $boxes[$i]['flags'][1] != 'noselect') &&
+ (isset($boxes[$i]['flags'][2]) && $boxes[$i]['flags'][2] != 'noselect')) {
$filters_spam_folder = $boxes[$i]['unformatted'];
}
}
- echo '