diff --git a/global_filter.module b/global_filter.module index d78bd69..2578544 100755 --- a/global_filter.module +++ b/global_filter.module @@ -63,9 +63,15 @@ function global_filter_init() { // Example: http://mysite.com?field_country=23,7,12 global_filter_set_on_session($name, explode(',', $_REQUEST[$name])); } - elseif (isset($_POST[$name]) && is_array($_POST[$name])) { - // Set value through post of a multi-valued widget. - global_filter_set_on_session($name, array_map('check_plain', $_POST[$name])); + elseif (isset($_POST[$name])) { + if (is_array($_POST[$name])) { + // Set value through post of a multi-valued widget. + global_filter_set_on_session($name, array_map('check_plain', $_POST[$name])); + } + else { + // Set value through post of a single-valued widget. + global_filter_set_on_session($name, check_plain($_POST[$name])); + } } else { $value = global_filter_get_session_value($name);