From 89c53fff7b228db209e17e1089c79a11a2867478 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 18 Dec 2009 12:24:03 -0500 Subject: [PATCH] $point is an array, need to check the array members, not if $point is empty --- kronolith/lib/Geo/Mysql.php | 4 ++-- kronolith/lib/Geo/Sql.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.11.0