From: marc tobias Date: Tue, 2 Apr 2019 14:52:37 +0000 (+0200) Subject: PDO library returns proper boolean. We dont need string comparison X-Git-Tag: v3.3.0~15^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/2ab836c11c3f4aa57a71aec18594ae59566b850c?hp=2a4198f94d1c52bb7e0042cf1b4074f277538384 PDO library returns proper boolean. We dont need string comparison --- diff --git a/lib/AddressDetails.php b/lib/AddressDetails.php index f5293586..2d40c84f 100644 --- a/lib/AddressDetails.php +++ b/lib/AddressDetails.php @@ -31,7 +31,7 @@ class AddressDetails private static function isAddress($aLine) { - return $aLine['isaddress'] == 't' || $aLine['type'] == 'country_code'; + return $aLine['isaddress'] || $aLine['type'] == 'country_code'; } public function getAddressDetails($bAll = false) @@ -49,7 +49,7 @@ class AddressDetails $sPrevResult = ''; foreach ($this->aAddressLines as $aLine) { - if ($aLine['isaddress'] == 't' && $sPrevResult != $aLine['localname']) { + if ($aLine['isaddress'] && $sPrevResult != $aLine['localname']) { $sPrevResult = $aLine['localname']; $aParts[] = $sPrevResult; } diff --git a/lib/template/details-html.php b/lib/template/details-html.php index 01583e5f..9ef59563 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -61,7 +61,7 @@ function _one_row($aAddressLine){ - $bNotUsed = (isset($aAddressLine['isaddress']) && $aAddressLine['isaddress'] == 'f'); + $bNotUsed = !$aAddressLine['isaddress']; echo ''."\n"; echo ' '.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name')."\n"; @@ -119,7 +119,7 @@ if ($aPointDetails['calculated_importance']) { kv('Importance' , $aPointDetails['calculated_importance'].($aPointDetails['importance']?'':' (estimated)') ); } - kv('Coverage' , ($aPointDetails['isarea']=='t'?'Polygon':'Point') ); + kv('Coverage' , ($aPointDetails['isarea']?'Polygon':'Point') ); kv('Centre Point' , $aPointDetails['lat'].','.$aPointDetails['lon'] ); kv('OSM' , osmLink($aPointDetails) ); if ($aPointDetails['wikipedia']) diff --git a/lib/template/details-json.php b/lib/template/details-json.php index 06554aba..4afb1b0b 100644 --- a/lib/template/details-json.php +++ b/lib/template/details-json.php @@ -33,7 +33,7 @@ if ($aPointDetails['icon']) { $aPlaceDetails['rank_address'] = (int) $aPointDetails['rank_address']; $aPlaceDetails['rank_search'] = (int) $aPointDetails['rank_search']; -$aPlaceDetails['isarea'] = ($aPointDetails['isarea'] == 't'); +$aPlaceDetails['isarea'] = $aPointDetails['isarea']; $aPlaceDetails['centroid'] = array( 'type' => 'Point', 'coordinates' => array( (float) $aPointDetails['lon'], (float) $aPointDetails['lat'] ) diff --git a/utils/update.php b/utils/update.php index a18c1721..c3620b06 100644 --- a/utils/update.php +++ b/utils/update.php @@ -352,7 +352,7 @@ if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) { $sBatchEnd = $aLastState['lastimportdate']; $iEndSequence = $aLastState['sequence_id']; - if ($aLastState['indexed'] == 't') { + if ($aLastState['indexed']) { // Sleep if the update interval has not yet been reached. $fNextUpdate = $aLastState['unix_ts'] + CONST_Replication_Update_Interval; if ($fNextUpdate > $fStartTime) { diff --git a/website/hierarchy.php b/website/hierarchy.php index b31b85d1..87e8a0af 100644 --- a/website/hierarchy.php +++ b/website/hierarchy.php @@ -121,7 +121,7 @@ if (!empty($aParentOfLines)) { echo '
'; echo ''.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name').''; echo ' ('; - echo ''.($aAddressLine['isarea']=='t'?'Polygon':'Point').''; + echo ''.($aAddressLine['isarea']?'Polygon':'Point').''; if ($sOSMType) echo ', '.$sOSMType.' '.osmLink($aAddressLine).''; echo ', GOTO'; echo ', '.$aAddressLine['area'];