summaryrefslogtreecommitdiffstats
path: root/Horde_Mime_php55.patch
blob: b4236381f7cc63cffe11fe6af85cb756208f78bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
--- lib/Horde/Mime.php.old	2012-12-21 16:08:45.404417508 +0100
+++ lib/Horde/Mime.php	2012-12-21 16:23:13.987453259 +0100
@@ -290,8 +290,9 @@
             switch ($encoding) {
             case 'Q':
             case 'q':
+                $callback = function($hex) { return chr(base_convert($hex[1],16,10)); };
                 $out .= Horde_String::convertCharset(
-                    preg_replace('/=([0-9a-f]{2})/ie', 'chr(0x\1)', str_replace('_', ' ', $encoded_text)),
+                    preg_replace_callback('/=([0-9a-f]{2})/i', $callback, str_replace('_', ' ', $encoded_text)),
                     $orig_charset,
                     'UTF-8'
                 );