summaryrefslogtreecommitdiff
path: root/lib/fuckhtml.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fuckhtml.php')
-rw-r--r--lib/fuckhtml.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/fuckhtml.php b/lib/fuckhtml.php
index 2f9d3aa..ed1252c 100644
--- a/lib/fuckhtml.php
+++ b/lib/fuckhtml.php
@@ -466,19 +466,26 @@ class fuckhtml{
return
preg_replace_callback(
- '/\\\u[A-Fa-f0-9]{4}|\\\x[A-Fa-f0-9]{2}/',
+ '/\\\u[A-Fa-f0-9]{4}|\\\x[A-Fa-f0-9]{2}|\\\n|\\\r/',
function($match){
- if($match[0][1] == "u"){
+ switch($match[0][1]){
- return json_decode('"' . $match[0] . '"');
- }else{
+ case "u":
+ return json_decode('"' . $match[0] . '"');
+ break;
- return mb_convert_encoding(
- stripcslashes($match[0]),
- "utf-8",
- "windows-1252"
- );
+ case "x":
+ return mb_convert_encoding(
+ stripcslashes($match[0]),
+ "utf-8",
+ "windows-1252"
+ );
+ break;
+
+ default:
+ return " ";
+ break;
}
},
$string