ソースを参照

the fuck? isset returns false if the variable is set but null. what the fuck lol

lolcat 6 ヶ月 前
コミット
afc7318cf7
1 ファイル変更2 行追加2 行削除
  1. 2 2
      lib/fuckhtml.php

+ 2 - 2
lib/fuckhtml.php

@@ -13,7 +13,7 @@ class fuckhtml{
 		
 		
 		if(is_array($html)){
 		if(is_array($html)){
 			
 			
-			if(!isset($html["innerHTML"])){
+			if(!array_key_exists("innerHTML", $html)){
 				
 				
 				throw new Exception("(load) Supplied array doesn't contain an innerHTML index");
 				throw new Exception("(load) Supplied array doesn't contain an innerHTML index");
 			}
 			}
@@ -339,7 +339,7 @@ class fuckhtml{
 		
 		
 		if(is_array($html)){
 		if(is_array($html)){
 			
 			
-			if(!isset($html["innerHTML"])){
+			if(!array_key_exists("innerHTML", $html)){
 				
 				
 				throw new Exception("(getTextContent) Supplied array doesn't contain an innerHTML index");
 				throw new Exception("(getTextContent) Supplied array doesn't contain an innerHTML index");
 			}
 			}