Permalink
Browse files

Ticket Filter Memory Leak

Fix case where filter applying 'Use Reply-To Email' filter action
triggers a reprocessing loop that exhausts php memory.
  • Loading branch information...
protich committed Nov 1, 2016
1 parent be3dc11 commit 84f085de94109cb6b69dc404952d038f6a2df4b5
Showing with 12 additions and 11 deletions.
  1. +10 −9 include/class.filter_action.php
  2. +2 −2 include/class.ticket.php
@@ -188,17 +188,18 @@ class FA_UseReplyTo extends TriggerAction {
static $name = /* @trans */ 'Use Reply-To Email';
function apply(&$ticket, array $info) {
if (!$info['reply-to'])
if (!$info['reply-to']
|| !$ticket['email']
|| !strcasecmp($info['reply-to'], $ticket['email']))
// Nothing to do
return;
$changed = $info['reply-to'] != $ticket['email']
|| ($info['reply-to-name'] && $ticket['name'] != $info['reply-to-name']);
if ($changed) {
$ticket['email'] = $info['reply-to'];
if ($info['reply-to-name'])
$ticket['name'] = $info['reply-to-name'];
throw new FilterDataChanged($ticket);
}
// Change email and throw data changed exception
$ticket['email'] = $info['reply-to'];
if ($info['reply-to-name'])
$ticket['name'] = $info['reply-to-name'];
throw new FilterDataChanged($ticket);
}
function getConfigurationOptions() {
View
@@ -3001,8 +3001,8 @@ protected function filterTicketData($origin, $vars, $forms, $user=false) {
$user_form = UserForm::getUserForm()->getForm($vars);
// Add all the user-entered info for filtering
foreach ($interesting as $F) {
$field = $user_form->getField($F);
$vars[$F] = $field->toString($field->getClean());
if ($field = $user_form->getField($F))
$vars[$F] = $field->toString($field->getClean());
}
// Attempt to lookup the user and associated data
$user = User::lookupByEmail($vars['email']);

0 comments on commit 84f085d

Please sign in to comment.