]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/reverse.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / reverse.php
index b6d0f5e6de0b3d406bfc99f94ab25cf349403650..0251c8c8206d122f24ca0867f1135f2efca61ee8 100755 (executable)
@@ -41,7 +41,7 @@ if ($sOsmType && $iOsmId > 0) {
 
     if ($oLookup) {
         $aPlaces = $oPlaceLookup->lookup(array($oLookup->iId => $oLookup));
-        if (sizeof($aPlaces)) {
+        if (!empty($aPlaces)) {
             $aPlace = reset($aPlaces);
         }
     }
@@ -62,9 +62,10 @@ if (isset($aPlace)) {
         $aPlace = array_merge($aPlace, $aOutlineResult);
     }
 } else {
-    $aPlace = [];
+    $aPlace = array();
 }
 
+logEnd($oDB, $hLog, sizeof($aPlace)?1:0);
 
 if (CONST_Debug) {
     var_dump($aPlace);
@@ -72,8 +73,10 @@ if (CONST_Debug) {
 }
 
 if ($sOutputFormat == 'html') {
-    $sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate - '2 minutes'::interval,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1"));
+    $sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1"));
     $sTileURL = CONST_Map_Tile_URL;
     $sTileAttribution = CONST_Map_Tile_Attribution;
 }
-include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php');
+
+$sOutputTemplate = ($sOutputFormat=='jsonv2' ? 'json' : $sOutputFormat);
+include(CONST_BasePath.'/lib/template/address-'.$sOutputTemplate.'.php');