Bug #9431: Fix infinite loop when prefs_init hook function recursively accessed the...
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Dec 2010 21:53:01 +0000 (14:53 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Dec 2010 21:53:58 +0000 (14:53 -0700)
framework/Prefs/lib/Horde/Prefs.php

index c5cd30b..f7f7af8 100644 (file)
@@ -350,13 +350,16 @@ class Horde_Prefs implements ArrayAccess
         $scope_ob = new Horde_Prefs_Scope($scope);
         $scope_ob->init = true;
 
+        // Need to set object in scopes array now, since the storage object
+        // might recursively call the prefs object.
+        $this->_scopes[$scope] = $scope_ob;
+
         foreach ($this->_storage as $storage) {
             $scope_ob = $storage->get($scope_ob);
         }
 
         $scope_ob->init = false;
 
-        $this->_scopes[$scope] = $scope_ob;
         $this->_cache->store($scope_ob);
     }