Commit 782b1cfb authored by catch's avatar catch

Issue #1315008 by bfroehle: Remove unnecessary validation in user/node list filtering.

parent 9988cc61
......@@ -242,12 +242,7 @@ function node_filter_form_submit($form, &$form_state) {
// Apply every filter that has a choice selected other than 'any'.
foreach ($filters as $filter => $options) {
if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '[any]') {
// Flatten the options array to accommodate hierarchical/nested options.
$flat_options = form_options_flatten($filters[$filter]['options']);
// Only accept valid selections offered on the dropdown, block bad input.
if (isset($flat_options[$form_state['values'][$filter]])) {
$_SESSION['node_overview_filter'][] = array($filter, $form_state['values'][$filter]);
}
$_SESSION['node_overview_filter'][] = array($filter, $form_state['values'][$filter]);
}
}
break;
......
......@@ -115,12 +115,7 @@ function user_filter_form_submit($form, &$form_state) {
// Apply every filter that has a choice selected other than 'any'.
foreach ($filters as $filter => $options) {
if (isset($form_state['values'][$filter]) && $form_state['values'][$filter] != '[any]') {
// Merge an array of arrays into one if necessary.
$options = ($filter == 'permission') ? form_options_flatten($filters[$filter]['options']) : $filters[$filter]['options'];
// Only accept valid selections offered on the dropdown, block bad input.
if (isset($options[$form_state['values'][$filter]])) {
$_SESSION['user_overview_filter'][] = array($filter, $form_state['values'][$filter]);
}
$_SESSION['user_overview_filter'][] = array($filter, $form_state['values'][$filter]);
}
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment