From 38287e6b8af92733e896d7c64b25eaf479633422 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 6 Nov 2013 21:43:07 +0000 Subject: [PATCH] Fix regression in filter processing Filters should not be run alongside basic ticket validation --- include/class.filter.php | 1 + include/class.ticket.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/class.filter.php b/include/class.filter.php index 319f7c0dc..3f01e5d0e 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -258,6 +258,7 @@ class Filter { return false; foreach ($this->getRules() as $rule) { + if (!isset($how[$rule['h']])) continue; list($func, $pos, $neg) = $how[$rule['h']]; # TODO: convert $what and $rule['v'] to mb_strtoupper and do # case-sensitive, binary-safe comparisons. Would be really diff --git a/include/class.ticket.php b/include/class.ticket.php index fc6499529..5565cfc2b 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1891,7 +1891,8 @@ class Ticket { // fields into local scope for filtering and banning purposes $user_form = UserForm::getInstance(); $user_info = $user_form->getClean(); - $vars += $user_info; + if ($user_form->isValid()) + $vars += $user_info; //Check for 403 if ($vars['email'] && Validator::is_email($vars['email'])) { -- GitLab