From: Michael J. Rubinsky Date: Fri, 18 Dec 2009 17:24:03 +0000 (-0500) Subject: $point is an array, need to check the array members, not if $point is empty X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=89c53fff7b228db209e17e1089c79a11a2867478;p=horde.git $point is an array, need to check the array members, not if $point is empty --- diff --git a/kronolith/lib/Geo/Mysql.php b/kronolith/lib/Geo/Mysql.php index 839e55aac..093d28349 100644 --- a/kronolith/lib/Geo/Mysql.php +++ b/kronolith/lib/Geo/Mysql.php @@ -32,10 +32,10 @@ class Kronolith_Geo_Mysql extends Kronolith_Geo_Sql } /* Do we actually have data? */ - if (!$point && $count) { + if ((empty($point['lat']) || empty($point['lon'])) && $count) { // Delete the record. $sql = "DELETE FROM kronolith_events_geo WHERE event_id = '" . $event_id . "'"; - } elseif (!$point) { + } elseif (empty($point['lat']) || empty($point['lon'])) { return; } diff --git a/kronolith/lib/Geo/Sql.php b/kronolith/lib/Geo/Sql.php index e6432935f..b8c463379 100644 --- a/kronolith/lib/Geo/Sql.php +++ b/kronolith/lib/Geo/Sql.php @@ -117,11 +117,11 @@ class Kronolith_Geo_Sql extends Kronolith_Geo throw new Horde_Exception($count->getMessage()); } - /* Do we actually have data? */ - if (!$point && $count) { + /* Do we actually have data? */ + if ((empty($point['lat']) || empty($point['lon'])) && $count) { // Delete the record. $sql = "DELETE FROM kronolith_events_geo WHERE event_id = '" . $event_id . "'"; - } elseif (!$point) { + } elseif (empty($point['lat']) || empty($point['lon'])) { return; }