summaryrefslogtreecommitdiff
path: root/framework/3rdParty/SafeHtml/TSafeHtmlParser.php
diff options
context:
space:
mode:
authorCiro Mattia Gonano <ciromattia@gmail.com>2013-07-29 11:51:43 +0200
committerCiro Mattia Gonano <ciromattia@gmail.com>2013-07-29 11:51:43 +0200
commitb833247ce597ec26159b46c8dfbea7f1e265950b (patch)
treeda9b1ed463ae65c7ca7d6093a47a8b19cbf73588 /framework/3rdParty/SafeHtml/TSafeHtmlParser.php
parentea20dd1900395dccdc620fba3e2ae73b4694a77c (diff)
Merge r3299
Diffstat (limited to 'framework/3rdParty/SafeHtml/TSafeHtmlParser.php')
-rw-r--r--framework/3rdParty/SafeHtml/TSafeHtmlParser.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/framework/3rdParty/SafeHtml/TSafeHtmlParser.php b/framework/3rdParty/SafeHtml/TSafeHtmlParser.php
index 119988d7..f26c0ae1 100644
--- a/framework/3rdParty/SafeHtml/TSafeHtmlParser.php
+++ b/framework/3rdParty/SafeHtml/TSafeHtmlParser.php
@@ -364,8 +364,21 @@ class TSafeHtmlParser
}
}
- $tempval = preg_replace('/&#(\d+);?/me', "chr('\\1')", $value); //"'
- $tempval = preg_replace('/&#x([0-9a-f]+);?/mei', "chr(hexdec('\\1'))", $tempval);
+ $tempval = preg_replace_callback(
+ '/&#(\d+);?/m',
+ function ($matches) {
+ return chr($matches[0]);
+ },
+ $value
+ ); //"'
+
+ $tempval = preg_replace_callback(
+ '/&#x([0-9a-f]+);?/mi',
+ function ($matches) {
+ return chr(hexdec($matches[0]));
+ },
+ $tempval
+ );
if ((in_array($name, $this->protocolAttributes)) &&
(strpos($tempval, ':') !== false))