From b88ddf4483c83fc665a979350e42e7efc6c6f235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Mon, 22 Jul 2013 15:39:50 +0200 Subject: [PATCH] [-] Classes : SwiftMailer - Fix deprecated preg_replace (PHP 5. 5.0) --- tools/swift/Swift/Message/Headers.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/swift/Swift/Message/Headers.php b/tools/swift/Swift/Message/Headers.php index f78184b5d..9b2ecc33d 100644 --- a/tools/swift/Swift/Message/Headers.php +++ b/tools/swift/Swift/Message/Headers.php @@ -420,8 +420,11 @@ class Swift_Message_Headers if (false !== $p = strpos($encoded_value[$key], $this->LE)) { - $cb = 'str_replace("' . $this->LE . '", "", "<$1>");'; - $encoded_value[$key] = preg_replace("/<([^>]+)>/e", $cb, $encoded_value[$key]); + $encoded_value[$key] = preg_replace_callback("/<([^>]+)>/", + function ($matches) + { + return str_replace("' . $this->LE . '", "", "<$matches[1]>"); + }, $encoded_value[$key]); } //Turn our header into an array of lines ready for wrapping around the encoding specification