$point is an array, need to check the array members, not if $point is empty
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 18 Dec 2009 17:24:03 +0000 (12:24 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 18 Dec 2009 17:24:03 +0000 (12:24 -0500)
kronolith/lib/Geo/Mysql.php
kronolith/lib/Geo/Sql.php

index 839e55a..093d283 100644 (file)
@@ -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;
         }
 
index e643293..b8c4633 100644 (file)
@@ -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;
         }