From ffdc7b51b7f07a1919cbaaafba5a5602671fb3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 29 Aug 2013 16:39:45 +0200 Subject: [PATCH] // php 5.2 --- tools/swift/Swift/Message/Headers.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/swift/Swift/Message/Headers.php b/tools/swift/Swift/Message/Headers.php index 9b2ecc33d..80a594c70 100644 --- a/tools/swift/Swift/Message/Headers.php +++ b/tools/swift/Swift/Message/Headers.php @@ -420,11 +420,7 @@ class Swift_Message_Headers if (false !== $p = strpos($encoded_value[$key], $this->LE)) { - $encoded_value[$key] = preg_replace_callback("/<([^>]+)>/", - function ($matches) - { - return str_replace("' . $this->LE . '", "", "<$matches[1]>"); - }, $encoded_value[$key]); + $encoded_value[$key] = preg_replace_callback("/<([^>]+)>/", array($this, 'prestaShopReplace'), $encoded_value[$key]); } //Turn our header into an array of lines ready for wrapping around the encoding specification @@ -556,6 +552,12 @@ class Swift_Message_Headers } return $ret; } + + public function prestaShopReplace($matches) + { + return str_replace("' . $this->LE . '", "", "<$matches[1]>"); + } + /** * Compile the list of headers which have been set and return an ascii string * The return value should always be 7-bit ascii and will have been cleaned for header injection