From e6f17efdaa80c20cd407fb5b1558bf1fc5d557c5 Mon Sep 17 00:00:00 2001 From: Linty Date: Wed, 12 Jun 2024 12:45:06 +0200 Subject: [PATCH] issue #2158 check webmaster_id before load_conf_from_db In Piwigo 15, configuration setting webmaster_id is moved from config files to database. It may be undefined at some point, with Piwigo 15+ scripts and a Piwigo 14 database schema not upgraded yet. Let's avoid any problem. --- include/common.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/common.inc.php b/include/common.inc.php index 6d88c59e5..3b63cdf04 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -124,6 +124,11 @@ catch (Exception $e) pwg_db_check_charset(); +// in Piwigo 15, configuration setting webmaster_id is moved from config files +// to database. It may be undefined at some point, with Piwigo 15+ scripts and +// a Piwigo 14 database schema not upgraded yet. Let's avoid any problem. +$conf['webmaster_id'] = $conf['webmaster_id'] ?? 1; + load_conf_from_db(); $logger = new Logger(array(