[icinga-checkins] icinga.org: icinga-web/master: Session: Fix write to database if date not initialized

git at icinga.org git at icinga.org
Tue Nov 18 17:10:11 CET 2014


Module: icinga-web
Branch: master
Commit: 9a2b433eec36b7945058502bedc08da44dac00fd
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=9a2b433eec36b7945058502bedc08da44dac00fd

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Oct 30 12:59:43 2014 +0100

Session: Fix write to database if date not initialized

Refs #7718

---

 .../AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php      |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
index 11e26a8..bc33324 100644
--- a/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
+++ b/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php
@@ -177,10 +177,10 @@ class AppKitDoctrineSessionStorage extends AgaviSessionStorage {
             $max = 1440;
         }
 
-        $date = DateTime::CreateFromFormat('Y-m-d H:i:s', $this->NsmSession->session_modified);
+        $date = DateTime::createFromFormat('Y-m-d H:i:s', $this->NsmSession->session_modified);
         $m = md5($data);
 
-        if ((time() - $date->getTimestamp()) >= $max) {
+        if ($date === false || (time() - $date->getTimestamp()) >= $max) {
             $update = true;
         }
 



More information about the icinga-checkins mailing list