From 2e9b5cbf5766e6ea2e30debfc8af54258d6aa254 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 8 Jul 2026 19:05:00 +0200 Subject: [PATCH] fix(prefs): guard config-file storage against null $registry global --- lib/Horde/Core/Prefs/Storage/Configuration.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Horde/Core/Prefs/Storage/Configuration.php b/lib/Horde/Core/Prefs/Storage/Configuration.php index b3d8bf0c..4eed8c20 100644 --- a/lib/Horde/Core/Prefs/Storage/Configuration.php +++ b/lib/Horde/Core/Prefs/Storage/Configuration.php @@ -29,6 +29,17 @@ public function get($scope_ob) { global $registry; + /* Modern PSR-15 request paths (e.g. the admin REST API) never + * populate $GLOBALS['registry']. Config-file defaults are a + * best-effort layer atop user prefs; when we cannot reach the + * registry, return the scope unchanged and let downstream + * storage drivers (SQL etc.) supply real values. Same graceful + * fallback shape as the try/catch below for missing prefs.php + * files. */ + if (!$registry instanceof Horde_Registry) { + return $scope_ob; + } + /* Read the configuration file. * Values are in the $_prefs array. */ try {