Explorar el Código

holy shit can i stop fucking up this function for fucks sake

lolcat hace 10 meses
padre
commit
c44d6292a0
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      lib/fuckhtml.php

+ 5 - 2
lib/fuckhtml.php

@@ -554,11 +554,14 @@ class fuckhtml{
 				case "\"":
 				case "\"":
 				case "'":
 				case "'":
 					if(
 					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 - 1] === "\\" &&
-								$json[$i - 2] === "\\"
+								(
+									$i === 2 ||
+									$json[$i - 2] === "\\"
+								)
 							) ||
 							) ||
 							$json[$i - 1] !== "\\"
 							$json[$i - 1] !== "\\"
 						)
 						)