Fix getting permanent error 502 while adding new city
parent
2179af8a91
commit
dbdc625ddb
|
@ -134,9 +134,6 @@ class CityController extends IntermediateController {
|
||||||
$cityDatas = json_decode($this->curlGET(
|
$cityDatas = json_decode($this->curlGET(
|
||||||
"http://api.openweathermap.org/data/2.5/forecast?q=".urlencode($name)."&mode=json&APPID=".urlencode($apiKey))[1],
|
"http://api.openweathermap.org/data/2.5/forecast?q=".urlencode($name)."&mode=json&APPID=".urlencode($apiKey))[1],
|
||||||
true);
|
true);
|
||||||
if (in_array('cod', $cityDatas)) {
|
|
||||||
return array("code" => 502, "response" => null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cityDatas['cod'] != '200') {
|
if ($cityDatas['cod'] != '200') {
|
||||||
return array("code" => $cityDatas['cod'], "response" => null, "apikey" => $apiKey);
|
return array("code" => $cityDatas['cod'], "response" => null, "apikey" => $apiKey);
|
||||||
|
|
Loading…
Reference in New Issue