]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
merge json and jsonv2 templates, they were very similar
[nominatim.git] / website / search.php
index bf9695ab52a3a73673cb691332103ac0bf4c31ab..346f5b5740a1f96380fb3518ec9b03cb7c259e1a 100755 (executable)
@@ -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');