replaces deprecated /e modifier in preg_replace
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 5 Jan 2015 15:04:16 +0000 (16:04 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 6 Jan 2015 08:44:43 +0000 (09:44 +0100)
... by using preg_replace_callback

Change-Id: Icac5749b5b2cf7e884900176809c7b782c3dc4fc
Reviewed-on: http://gerrit.tine20.com/customers/1503
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Felamimail/Message.php

index 9aeee9e..80588c9 100644 (file)
@@ -60,7 +60,9 @@ class Felamimail_Message extends Zend_Mail_Message
     {
         $string = $_string;
         if (preg_match('/=?[\d,\w,-]*?[q,Q,b,B]?.*?=/', $string)) {
-            $string = preg_replace('/(=[1-9,a-f]{2})/e', "strtoupper('\\1')", $string);
+            $string = preg_replace_callback('/(=[1-9,a-f]{2})/', function ($matches) { 
+                return strtoupper($matches[1]);
+            }, $string);
             if ($_isHeader) {
                 $string = iconv_mime_decode($string, 2);
             }