Skip to content

Commit

Permalink
bug fix : url encode sur les noms des villes lors de la requete de ge…
Browse files Browse the repository at this point in the history
…ocodage #37
  • Loading branch information
oceanBigOne authored and ColinMaudry committed Mar 31, 2017
1 parent 66dcfb4 commit 5cf705f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion class/Candidature.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public function saveWithPDOSecure(){

public function geocode(){
//requete : on ne recupere que les coordonnées GPS de la ville
$query="http://api-adresse.data.gouv.fr/search/?q=".$this->getCity().",".$this->getZipcode()."&limit=1";
$query="http://api-adresse.data.gouv.fr/search/?q=".urlencode($this->getCity().",".$this->getZipcode())."&limit=1";
$aContext=array('http'=>array('timeout'=>3)); //in second
$context = stream_context_create($aContext);
$response=file_get_contents($query,0,$context);
Expand Down

0 comments on commit 5cf705f

Please sign in to comment.