فهرست منبع

messed up json extractor

lolcat 11 ماه پیش
والد
کامیت
de328fff1b
1فایلهای تغییر یافته به همراه5 افزوده شده و 7 حذف شده
  1. 5 7
      lib/fuckhtml.php

+ 5 - 7
lib/fuckhtml.php

@@ -554,14 +554,12 @@ class fuckhtml{
 				case "\"":
 				case "\"":
 				case "'":
 				case "'":
 					if(
 					if(
-						$i > 2 ||
+						$i > 2 && // only check if a quote could be there
 						(
 						(
-							(
-								$json[$i - 1] === "\\" &&
-								$json[$i - 2] === "\\"
-							) ||
-							$json[$i - 1] !== "\\"
-						)
+							$json[$i - 1] === "\\" &&
+							$json[$i - 2] === "\\"
+						) ||
+						$json[$i - 1] !== "\\"
 					){
 					){
 						// found a non-escaped quote
 						// found a non-escaped quote