From e1ebef8ce90ec34c90cbdad856afc555e15b1c3f Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 9 Dec 2010 14:53:01 -0700 Subject: [PATCH] Bug #9431: Fix infinite loop when prefs_init hook function recursively accessed the prefs object --- framework/Prefs/lib/Horde/Prefs.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/Prefs/lib/Horde/Prefs.php b/framework/Prefs/lib/Horde/Prefs.php index c5cd30b0c..f7f7af8e7 100644 --- a/framework/Prefs/lib/Horde/Prefs.php +++ b/framework/Prefs/lib/Horde/Prefs.php @@ -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); } -- 2.11.0