Sfoglia il codice sorgente

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

lolcat 6 mesi fa
parent
commit
afc7318cf7
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      lib/fuckhtml.php

+ 2 - 2
lib/fuckhtml.php

@@ -13,7 +13,7 @@ class fuckhtml{
 		
 		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");
 			}
@@ -339,7 +339,7 @@ class fuckhtml{
 		
 		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");
 			}