From 683812e3e6646633f57e90e82c64080d0b0fbe9f Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@enhancesoft.com>
Date: Tue, 16 Apr 2019 22:57:42 +0000
Subject: [PATCH] Mime Decode - Encoded chars

This commit addresses an issue where pre_replace fails in php 7.x resulting
in a ticket with an empty body.
---
 include/pear/Mail/mimeDecode.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/pear/Mail/mimeDecode.php b/include/pear/Mail/mimeDecode.php
index 9b1e208be..02f00f068 100644
--- a/include/pear/Mail/mimeDecode.php
+++ b/include/pear/Mail/mimeDecode.php
@@ -645,7 +645,10 @@ class Mail_mimeDecode extends PEAR
         $input = preg_replace("/=\r?\n/", '', $input);
 
         // Replace encoded characters
-		$input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
+       $input = preg_replace_callback('/=([a-f0-9]{2})/i',
+               create_function('$matches',
+                   ' return chr(hexdec($matches[0]));'),
+               $input);
 
         return $input;
     }
-- 
GitLab