From c44d6292a02041dca8d0f572ee7d00e01254ab48 Mon Sep 17 00:00:00 2001 From: lolcat Date: Sat, 6 Sep 2025 09:44:05 -0400 Subject: [PATCH] holy shit can i stop fucking up this function for fucks sake --- lib/fuckhtml.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/fuckhtml.php b/lib/fuckhtml.php index c914bc6..b05c5b2 100644 --- a/lib/fuckhtml.php +++ b/lib/fuckhtml.php @@ -554,11 +554,14 @@ class fuckhtml{ case "\"": case "'": if( - $i > 2 && // only check if a quote could be there + $i > 1 && // only check if a quote could be there ( ( $json[$i - 1] === "\\" && - $json[$i - 2] === "\\" + ( + $i === 2 || + $json[$i - 2] === "\\" + ) ) || $json[$i - 1] !== "\\" )