From 7affd7dc671291bc6d32b9558cad2a2b96a13581 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Sat, 21 Nov 2015 09:30:54 +0100 Subject: [PATCH] Fix spaces incorrectly used when fetching the city when wanted to add it --- controller/citycontroller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/controller/citycontroller.php b/controller/citycontroller.php index 1a328b5..9ec9ce5 100644 --- a/controller/citycontroller.php +++ b/controller/citycontroller.php @@ -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;