From: Jan Schneider Date: Wed, 11 Aug 2010 14:25:49 +0000 (+0200) Subject: Only set geolocation if it has been submitted. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d41360ba4725dcd4c47662cf3849c33953b62ae5;p=horde.git Only set geolocation if it has been submitted. --- diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index a9a2c536b..cd446e70d 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -2380,9 +2380,12 @@ abstract class Kronolith_Event $this->_tags = Horde_Util::getFormData('tags', $this->tags); // Geolocation - $this->setGeoLocation(array('lat' => Horde_Util::getFormData('lat'), - 'lon' => Horde_Util::getFormData('lon'), - 'zoom' => Horde_Util::getFormData('zoom'))); + if (Horde_Util::getFormData('lat') && Horde_Util::getFormData('lon')) { + $this->setGeoLocation(array('lat' => Horde_Util::getFormData('lat'), + 'lon' => Horde_Util::getFormData('lon'), + 'zoom' => Horde_Util::getFormData('zoom'))); + } + $this->initialized = true; } @@ -2846,7 +2849,8 @@ abstract class Kronolith_Event public function getGeolocation() { /* Get geolocation data */ - if (($gDriver = Kronolith::getGeoDriver()) && !isset($this->_geoLocation)) { + if (!isset($this->_geoLocation) && + ($gDriver = Kronolith::getGeoDriver())) { try { $this->_geoLocation = $gDriver->getLocation($this->id); } catch (Exception $e) {}