X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/282c6777ee11360b1b5bd8e60196d81f90480c79..88beeb79164d0fec40778678e5d93ae44b8f07d8:/website/search.php diff --git a/website/search.php b/website/search.php index bf9695ab..346f5b57 100755 --- a/website/search.php +++ b/website/search.php @@ -28,7 +28,7 @@ if (CONST_Search_ReversePlanForAll // Format for output $sOutputFormat = $oParams->getSet('format', array('html', 'xml', 'json', 'jsonv2'), 'html'); -$sForcedGeometry = ($sOutputFormat == 'html') ? "geojson" : null; +$sForcedGeometry = ($sOutputFormat == 'html') ? 'geojson' : null; $oGeocode->loadParamArray($oParams, $sForcedGeometry); if (CONST_Search_BatchMode && isset($_GET['batch'])) { @@ -74,11 +74,12 @@ $sQuery = $oGeocode->getQueryString(); $aMoreParams = $oGeocode->getMoreUrlParams(); if ($sOutputFormat != 'html') $aMoreParams['format'] = $sOutputFormat; -if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) { - $aMoreParams['accept-language'] = $_SERVER["HTTP_ACCEPT_LANGUAGE"]; +if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + $aMoreParams['accept-language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE']; } $sMoreURL = CONST_Website_BaseURL.'search.php?'.http_build_query($aMoreParams); if (CONST_Debug) exit; -include(CONST_BasePath.'/lib/template/search-'.$sOutputFormat.'.php'); +$sOutputTemplate = ($sOutputFormat=='jsonv2' ? 'json' : $sOutputFormat); +include(CONST_BasePath.'/lib/template/search-'.$sOutputTemplate.'.php');