mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
replace PHP sizeof() with either count() or empty()
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
$aFilteredPlaces = array();
|
||||
|
||||
if (!sizeof($aPlace)) {
|
||||
if (empty($aPlace)) {
|
||||
if (isset($sError))
|
||||
$aFilteredPlaces['error'] = $sError;
|
||||
else $aFilteredPlaces['error'] = 'Unable to geocode';
|
||||
|
||||
@@ -11,7 +11,7 @@ echo " attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.ope
|
||||
echo " querystring='".htmlspecialchars($_SERVER['QUERY_STRING'], ENT_QUOTES)."'";
|
||||
echo ">\n";
|
||||
|
||||
if (!sizeof($aPlace)) {
|
||||
if (empty($aPlace)) {
|
||||
if (isset($sError))
|
||||
echo "<error>$sError</error>";
|
||||
else echo '<error>Unable to geocode</error>';
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($aParentOfLines))
|
||||
if (!empty($aParentOfLines))
|
||||
{
|
||||
headline('Parent Of');
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
_one_row($aAddressLine);
|
||||
}
|
||||
}
|
||||
if (sizeof($aParentOfLines) >= 500) {
|
||||
if (count($aParentOfLines) >= 500) {
|
||||
echo '<p>There are more child objects which are not shown.</p>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ foreach ($aBatchResults as $aSearchResults) {
|
||||
$aPlace['icon'] = $aPointDetails['icon'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) {
|
||||
if (isset($aPointDetails['address']) && !empty($aPointDetails['address'])) {
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
echo '</div>';
|
||||
$i = $i+1;
|
||||
}
|
||||
if (sizeof($aSearchResults) && $sMoreURL)
|
||||
if (!empty($aSearchResults) && $sMoreURL)
|
||||
{
|
||||
echo '<div class="more"><a class="btn btn-primary" href="'.htmlentities($sMoreURL).'">Search for more results</a></div>';
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
|
||||
$aPlace['icon'] = $aPointDetails['icon'];
|
||||
}
|
||||
|
||||
if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])) {
|
||||
if (isset($aPointDetails['address']) && !empty($aPointDetails['address'])) {
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user