Fixed the $settings object being singular when it should be plural (#7610)

This pull request fixes an error when the settings object is assigned to a singular variable of `$setting` instead of `$settings`. This makes the included files run potentially the wrong domain name.

Optimize the `upgrade()` method of the `domains.php` to reduce filesystem operations.
This commit is contained in:
frytimo
2025-11-12 19:02:57 -04:00
committed by GitHub
parent 4809dc34ce
commit 5d5f00f82c

View File

@@ -654,6 +654,9 @@ class domains {
$domains = $this->database->select($sql, null, 'all'); $domains = $this->database->select($sql, null, 'all');
unset($sql); unset($sql);
//get the list of installed apps from the core and mod directories
$default_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_defaults.php");
//loop through all domains //loop through all domains
$domains_processed = 1; $domains_processed = 1;
foreach ($domains as $domain) { foreach ($domains as $domain) {
@@ -665,15 +668,14 @@ class domains {
$context = $domain_name; $context = $domain_name;
//get the email queue settings //get the email queue settings
$setting = new settings(["database" => $this->database, "domain_uuid" => $domain_uuid]); $settings = new settings(["database" => $this->database, "domain_uuid" => $domain_uuid]);
//get the list of installed apps from the core and mod directories and run the php code in app_defaults.php //run the php code in app_defaults.php
$default_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_defaults.php");
foreach ($default_list as $default_path) { foreach ($default_list as $default_path) {
include($default_path); include($default_path);
} }
//track of the number of domains processed //track the number of domains processed
$domains_processed++; $domains_processed++;
} }