From 62c7584e781b6d8bffd88796e53d886b426e1d9a Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 7 Aug 2015 12:08:57 -0500
Subject: [PATCH] filter: Fix recursion if reply-to action used with non-email
 sources

---
 include/class.filter_action.php | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/class.filter_action.php b/include/class.filter_action.php
index d2d2bef95..b78a8de31 100644
--- a/include/class.filter_action.php
+++ b/include/class.filter_action.php
@@ -188,16 +188,17 @@ class FA_UseReplyTo extends TriggerAction {
     static $name = /* @trans */ 'Use Reply-To Email';
 
     function apply(&$ticket, array $info) {
-        $config = $this->getConfiguration();
+        if (!$info['reply-to'])
+            // Nothing to do
+            return;
         $changed = $info['reply-to'] != $ticket['email']
             || ($info['reply-to-name'] && $ticket['name'] != $info['reply-to-name']);
-        if ($info['reply-to']) {
+        if ($changed) {
             $ticket['email'] = $info['reply-to'];
             if ($info['reply-to-name'])
                 $ticket['name'] = $info['reply-to-name'];
-        }
-        if ($changed)
             throw new FilterDataChanged($ticket);
+        }
     }
 
     function getConfigurationOptions() {
-- 
GitLab