summaryrefslogtreecommitdiff
path: root/lib/fuckhtml.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2024-02-17 23:22:19 -0500
committerlolcat <will@lolcat.ca>2024-02-17 23:22:19 -0500
commitaddc5a14a93547f630f23e5b6a79cffa2e37d71a (patch)
treea9163ba3a2e24c3c493cdde95e506c0e7e8a772d /lib/fuckhtml.php
parentedc917f5ee984160a0eef436dabd51696d675964 (diff)
boobs
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