Fix spaces incorrectly used when fetching the city when wanted to add it
parent
1fd97bf94f
commit
7affd7dc67
|
@ -106,6 +106,7 @@ class CityController extends Controller {
|
|||
}
|
||||
|
||||
private function getCityInformations ($name) {
|
||||
$name = preg_replace("[ ]",'%20',$name);
|
||||
$cityDatas = json_decode(file_get_contents("http://api.openweathermap.org/data/2.5/forecast?q=$name&mode=json&APPID=".$this->apiKey), true);
|
||||
if ($cityDatas['cod'] != '200') {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue