From edc0817422999d2ef6772776a6086739d113b47d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 30 Nov 2010 21:36:43 -0700 Subject: [PATCH] Don't store session values if they are empty --- ingo/lib/Ingo.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ingo/lib/Ingo.php b/ingo/lib/Ingo.php index 98b1e6480..acd00691b 100644 --- a/ingo/lib/Ingo.php +++ b/ingo/lib/Ingo.php @@ -33,6 +33,7 @@ class Ingo * Create an ingo session. * * Creates the $ingo session variable with the following entries: + *
      * 'backend' (array) - The backend configuration to use.
      * 'change' (integer) - The timestamp of the last time the rules were
      *                      altered.
@@ -41,6 +42,7 @@ class Ingo
      *                               Ingo_Script driver in use.
      * 'script_generate' (boolean) - Is the Ingo_Script::generate() call
      *                               available?
+     * 
* * @throws Ingo_Exception */ @@ -49,21 +51,21 @@ class Ingo global $prefs, $session; $session->remove('ingo'); - if ($session->exists('ingo', 'change')) { + if ($session->exists('ingo', 'script_generate')) { return; } /* getBackend() and loadIngoScript() will both throw Exceptions, so * do these first as errors are fatal. */ foreach (self::getBackend() as $key => $val) { - $session->set('ingo', 'backend/' . $key, $val); + if ($val) { + $session->set('ingo', 'backend/' . $key, $val); + } } $ingo_script = self::loadIngoScript(); $session->set('ingo', 'script_generate', $ingo_script->generateAvailable()); - $session->set('ingo', 'change', 0); - /* Disable categories as specified in preferences */ $categories = array_merge($ingo_script->availableActions(), $ingo_script->availableCategories()); if ($prefs->isLocked('blacklist')) { -- 2.11.0