소스 검색

brave crash fix

lolcat 1 년 전
부모
커밋
920b9d5b3f
1개의 변경된 파일12개의 추가작업 그리고 3개의 파일을 삭제
  1. 12 3
      scraper/brave.php

+ 12 - 3
scraper/brave.php

@@ -673,7 +673,10 @@ class brave{
 					$table["Address"] = $result["location"]["postal_address"]["displayAddress"];
 					$table["Address"] = $result["location"]["postal_address"]["displayAddress"];
 				}
 				}
 				
 				
-				if(isset($result["location"]["rating"])){
+				if(
+					isset($result["location"]["rating"]) &&
+					$result["location"]["rating"] != "void 0"
+				){
 					
 					
 					$table["Rating"] =
 					$table["Rating"] =
 						$result["location"]["rating"]["ratingValue"] . "/" .
 						$result["location"]["rating"]["ratingValue"] . "/" .
@@ -681,13 +684,19 @@ class brave{
 						number_format($result["location"]["rating"]["reviewCount"]) . " votes)";
 						number_format($result["location"]["rating"]["reviewCount"]) . " votes)";
 				}
 				}
 				
 				
-				if(isset($result["location"]["contact"]["telephone"])){
+				if(
+					isset($result["location"]["contact"]["telephone"]) &&
+					$result["location"]["contact"]["telephone"] != "void 0"
+				){
 					
 					
 					$table["Phone number"] =
 					$table["Phone number"] =
 						$result["location"]["contact"]["telephone"];
 						$result["location"]["contact"]["telephone"];
 				}
 				}
 				
 				
-				if(isset($result["location"]["price_range"])){
+				if(
+					isset($result["location"]["price_range"]) &&
+					$result["location"]["price_range"] != "void 0"
+				){
 					
 					
 					$table["Price"] =
 					$table["Price"] =
 						$result["location"]["price_range"];
 						$result["location"]["price_range"];