diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 67d88e69a..7e979e4d3 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -875,9 +875,13 @@ class AdminControllerCore extends Controller $prefix = $this->getCookieFilterPrefix(); $filters = array(); if (isset($this->list_id)) { + $postPrefixPattern = '#^('. + $this->list_id.'Filter_|'. + 'submitFilter'. + ')#i'; foreach ($_POST as $key => $value) { // only process the filter fields. - if (stripos($key, $this->list_id.'Filter_') !== 0) { + if (!preg_match($postPrefixPattern, $key)) { continue; } @@ -898,9 +902,15 @@ class AdminControllerCore extends Controller } } + $getPrefixPattern = '#^(' . + 'submitFilter|'. + $this->list_id.'Filter_|'. + $this->list_id.'Orderby|'. + $this->list_id.'Orderway'. + ')#i'; foreach ($_GET as $key => $value) { - // only process the filter fields. - if (stripos($key, $this->list_id.'Filter_') !== 0) { + // only process the filter and order by, order way fields. + if (!preg_match($getPrefixPattern, $key)) { continue; }