From 5d5f00f82c2ff8c98f214e65e13d738cae0314bd Mon Sep 17 00:00:00 2001 From: frytimo Date: Wed, 12 Nov 2025 19:02:57 -0400 Subject: [PATCH] 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. --- resources/classes/domains.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/classes/domains.php b/resources/classes/domains.php index dcf3655efc..4d3161bb60 100644 --- a/resources/classes/domains.php +++ b/resources/classes/domains.php @@ -654,6 +654,9 @@ class domains { $domains = $this->database->select($sql, null, 'all'); 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 $domains_processed = 1; foreach ($domains as $domain) { @@ -665,15 +668,14 @@ class domains { $context = $domain_name; //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 - $default_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_defaults.php"); + //run the php code in app_defaults.php foreach ($default_list as $default_path) { include($default_path); } - //track of the number of domains processed + //track the number of domains processed $domains_processed++; }