Skip to content

Commit

Permalink
issue #2158 check webmaster_id before load_conf_from_db
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LintyDev committed Jun 12, 2024
1 parent badc7c7 commit e6f17ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/common.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ function sanitize_mysql_kv(&$v, $k)

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(
Expand Down

0 comments on commit e6f17ef

Please sign in to comment.