From 453945da14c6c7354535189d251c5eda193253ca Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Wed, 20 Nov 2019 14:21:30 +0000 Subject: [PATCH 1/4] FIX: Session::restart() didn't correctly restart session (fixes #9259) --- src/Control/Session.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Control/Session.php b/src/Control/Session.php index 638cd7fe7..b7a4e1ade 100644 --- a/src/Control/Session.php +++ b/src/Control/Session.php @@ -226,9 +226,7 @@ class Session if (isset($this->data['HTTP_USER_AGENT'])) { if ($this->data['HTTP_USER_AGENT'] !== $this->userAgent($request)) { $this->clearAll(); - $this->destroy(); - $this->started = false; - $this->start($request); + $this->restart($request); } } } @@ -241,7 +239,7 @@ class Session public function restart(HTTPRequest $request) { $this->destroy(); - $this->init($request); + $this->start($request); } /** @@ -369,6 +367,7 @@ class Session // http://nz1.php.net/manual/en/function.session-destroy.php unset($_SESSION); $this->data = null; + $this->started = false; } /** From a42249b6fc586aca76a1042f5f46645add8a97ad Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Thu, 19 Dec 2019 14:39:46 +0000 Subject: [PATCH 2/4] Minor performance improvement in DatabaseAdapterRegistry::autoconfigure() --- src/Dev/Install/DatabaseAdapterRegistry.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Dev/Install/DatabaseAdapterRegistry.php b/src/Dev/Install/DatabaseAdapterRegistry.php index ae5cbf101..0abce6a23 100644 --- a/src/Dev/Install/DatabaseAdapterRegistry.php +++ b/src/Dev/Install/DatabaseAdapterRegistry.php @@ -145,12 +145,8 @@ class DatabaseAdapterRegistry $databaseConfig = $config; } // Search through all composer packages in vendor, updating $databaseConfig - foreach (glob(BASE_PATH . '/vendor/*', GLOB_ONLYDIR) as $vendor) { - foreach (glob($vendor . '/*', GLOB_ONLYDIR) as $directory) { - if (file_exists($directory . '/_configure_database.php')) { - include_once($directory . '/_configure_database.php'); - } - } + foreach (glob(BASE_PATH . '/vendor/*/*/_configure_database.php') as $configFile) { + include_once $configFile; } // Update modified variable $config = $databaseConfig; From 18f0829053bf854ea3be6b8808f60868c1617c4c Mon Sep 17 00:00:00 2001 From: Nemanja Karadzic Date: Tue, 14 Jan 2020 14:20:40 +0100 Subject: [PATCH 3/4] Fixed issue with merging existing entities in text collector --- src/i18n/TextCollection/i18nTextCollector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/TextCollection/i18nTextCollector.php b/src/i18n/TextCollection/i18nTextCollector.php index 287fcbbeb..de9f7210e 100644 --- a/src/i18n/TextCollection/i18nTextCollector.php +++ b/src/i18n/TextCollection/i18nTextCollector.php @@ -378,8 +378,8 @@ class i18nTextCollector // Merge if ($existingMessages) { $entitiesByModule[$module] = array_merge( - $existingMessages, - $messages + $messages, + $existingMessages ); } } From ec6a35354383cc18db9562af7b25841bfb2cd673 Mon Sep 17 00:00:00 2001 From: Martin D Date: Thu, 9 Jan 2020 13:41:28 -0500 Subject: [PATCH 4/4] array_key_exists() on objects is deprecated Ref: https://wiki.php.net/rfc/deprecations_php_7_4#array_key_exists_with_objects --- src/ORM/ArrayList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ORM/ArrayList.php b/src/ORM/ArrayList.php index cd60f6eb7..2dfa61717 100644 --- a/src/ORM/ArrayList.php +++ b/src/ORM/ArrayList.php @@ -588,7 +588,7 @@ class ArrayList extends ViewableData implements SS_List, Filterable, Sortable, L $firstRecord = $this->first(); - return array_key_exists($by, $firstRecord); + return is_array($firstRecord) ? array_key_exists($by, $firstRecord) : property_exists($by, $firstRecord); } /**