X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins%2Fgis%2Faction%2Fgis_geocoder_rechercher.php;h=feaebc43ebfd1e666565fd2d09a32c464a6f7352;hb=4f443dce95ff6f8221c189880a70c74ce1c1f238;hp=3e7f7576c3f9a8e36855a80b323d2c7776c699d7;hpb=4a628e9b277d3617535f99d663ca79fa2e891177;p=lhc%2Fweb%2Fwww.git diff --git a/www/plugins/gis/action/gis_geocoder_rechercher.php b/www/plugins/gis/action/gis_geocoder_rechercher.php index 3e7f7576..feaebc43 100644 --- a/www/plugins/gis/action/gis_geocoder_rechercher.php +++ b/www/plugins/gis/action/gis_geocoder_rechercher.php @@ -23,7 +23,7 @@ function action_gis_geocoder_rechercher_dist() { } /* On filtre les arguments à renvoyer à Nomatim (liste blanche) */ - $arguments = collecter_requests(array('json_callback', 'format', 'q', 'limit', 'addressdetails', 'accept-language', 'lat', 'lon'), array()); + $arguments = collecter_requests(array('format', 'q', 'limit', 'addressdetails', 'accept-language', 'lat', 'lon'), array()); $geocoder = defined('_GIS_GEOCODER') ? _GIS_GEOCODER : 'photon'; @@ -31,7 +31,8 @@ function action_gis_geocoder_rechercher_dist() { header('Content-Type: application/json; charset=UTF-8'); if ($geocoder == 'photon') { if (isset($arguments['accept-language'])) { - $arguments['lang'] = $arguments['accept-language']; + // ne garder que les deux premiers caractères du code de langue, car les variantes spipiennes comme fr_fem posent problème + $arguments['lang'] = substr($arguments['accept-language'], 0, 2); unset($arguments['accept-language']); } if ($mode == 'search') {