From addc5a14a93547f630f23e5b6a79cffa2e37d71a Mon Sep 17 00:00:00 2001 From: lolcat Date: Sat, 17 Feb 2024 23:22:19 -0500 Subject: boobs --- lib/fuckhtml.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'lib/fuckhtml.php') 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 -- cgit v1.2.3