From ea6bf1ddb26648767fc92abbf0bbac91fb60d747 Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 15 Sep 2011 08:37:57 +0000 Subject: - Fixed handling of enabled magic_quotes_gpc setting - Fixed PHP warning on connection error when submitting filter form - Fixed bug where new action row with flags wasn't handled properly git-svn-id: https://svn.roundcube.net/trunk@5215 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/Changelog | 3 ++ plugins/managesieve/lib/rcube_sieve_script.php | 2 +- plugins/managesieve/managesieve.php | 50 +++++++++++++------------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 23232f5d8..3d0e6a6b3 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,6 +1,9 @@ - Added possibility to create a filter based on selected message "in-place" - Fixed import from Horde-INGO (#1488064) - Add managesieve_script_name option for default name of the script (#1487956) +- Fixed handling of enabled magic_quotes_gpc setting +- Fixed PHP warning on connection error when submitting filter form +- Fixed bug where new action row with flags wasn't handled properly * version 4.3 [2011-07-28] ----------------------------------------------------------- diff --git a/plugins/managesieve/lib/rcube_sieve_script.php b/plugins/managesieve/lib/rcube_sieve_script.php index ee2780266..65f8d865c 100644 --- a/plugins/managesieve/lib/rcube_sieve_script.php +++ b/plugins/managesieve/lib/rcube_sieve_script.php @@ -684,7 +684,7 @@ class rcube_sieve_script // String atom default: // empty or one character - if ($str === '') { + if ($str === '' || $str === null) { break 2; } if (strlen($str) < 2) { diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index da3d4c069..a52170fb1 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -495,22 +495,22 @@ class managesieve extends rcube_plugin $join = trim(get_input_value('_join', RCUBE_INPUT_POST)); // and arrays - $headers = $_POST['_header']; - $cust_headers = $_POST['_custom_header']; - $ops = $_POST['_rule_op']; - $sizeops = $_POST['_rule_size_op']; - $sizeitems = $_POST['_rule_size_item']; - $sizetargets = $_POST['_rule_size_target']; - $targets = $_POST['_rule_target']; - $act_types = $_POST['_action_type']; - $mailboxes = $_POST['_action_mailbox']; - $act_targets = $_POST['_action_target']; - $area_targets = $_POST['_action_target_area']; - $reasons = $_POST['_action_reason']; - $addresses = $_POST['_action_addresses']; - $days = $_POST['_action_days']; - $subject = $_POST['_action_subject']; - $flags = $_POST['_action_flags']; + $headers = get_input_value('_header', RCUBE_INPUT_POST); + $cust_headers = get_input_value('_custom_header', RCUBE_INPUT_POST); + $ops = get_input_value('_rule_op', RCUBE_INPUT_POST); + $sizeops = get_input_value('_rule_size_op', RCUBE_INPUT_POST); + $sizeitems = get_input_value('_rule_size_item', RCUBE_INPUT_POST); + $sizetargets = get_input_value('_rule_size_target', RCUBE_INPUT_POST); + $targets = get_input_value('_rule_target', RCUBE_INPUT_POST, true); + $act_types = get_input_value('_action_type', RCUBE_INPUT_POST, true); + $mailboxes = get_input_value('_action_mailbox', RCUBE_INPUT_POST, true); + $act_targets = get_input_value('_action_target', RCUBE_INPUT_POST, true); + $area_targets = get_input_value('_action_target_area', RCUBE_INPUT_POST, true); + $reasons = get_input_value('_action_reason', RCUBE_INPUT_POST, true); + $addresses = get_input_value('_action_addresses', RCUBE_INPUT_POST, true); + $days = get_input_value('_action_days', RCUBE_INPUT_POST); + $subject = get_input_value('_action_subject', RCUBE_INPUT_POST, true); + $flags = get_input_value('_action_flags', RCUBE_INPUT_POST); // we need a "hack" for radiobuttons foreach ($sizeitems as $item) @@ -715,7 +715,7 @@ class managesieve extends rcube_plugin $i++; } - if (!$this->errors) { + if (!$this->errors && !$error) { // zapis skryptu if (!isset($this->script[$fid])) { $fid = $this->sieve->script->add_rule($this->form); @@ -1157,7 +1157,7 @@ class managesieve extends rcube_plugin $out .= '
'; // action select - $select_action = new html_select(array('name' => "_action_type[]", 'id' => 'action_type'.$id, + $select_action = new html_select(array('name' => "_action_type[$id]", 'id' => 'action_type'.$id, 'onchange' => 'action_type_select(' .$id .')')); if (in_array('fileinto', $this->exts)) $select_action->add(Q($this->gettext('messagemoveto')), 'fileinto'); @@ -1191,11 +1191,11 @@ class managesieve extends rcube_plugin // actions target inputs $out .= ''; // shared targets - $out .= 'error_class($id, 'action', 'target', 'action_target') .' />'; - $out .= '\n"; $out .= '
' .Q($this->gettext('vacationsubject')) . '
' - .'error_class($id, 'action', 'subject', 'action_subject') .' />'; $out .= '
' .Q($this->gettext('vacationaddresses')) . '
' - .'error_class($id, 'action', 'addresses', 'action_addr') .' />'; $out .= '
' . Q($this->gettext('vacationdays')) . '
' - .'error_class($id, 'action', 'days', 'action_days') .' />'; $out .= ''; @@ -1252,7 +1252,7 @@ class managesieve extends rcube_plugin 'realnames' => false, 'maxlength' => 100, 'id' => 'action_mailbox' . $id, - 'name' => '_action_mailbox[]', + 'name' => "_action_mailbox[$id]", 'style' => 'display:'.(!isset($action) || $action['type']=='fileinto' ? 'inline' : 'none') )); $out .= $select->show($mailbox); -- cgit v1.2.3