Skip to content

Commit 64d2597

Browse files
committed
Fallback method patch.
Changelog excerpt: - Precaution against potential future undefined index added to fallback method.
1 parent 64eb4e3 commit 64d2597

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
5555
### v3.2.2
5656

5757
[2021.06.10; Maikuolan]: Added a flag for successful hits against blacklisted filetypes (needed by the upload handler for a newly added configuration directive). Also did some very minor refactoring.
58+
59+
[2021.09.05; Maikuolan]: Precaution against potential future undefined index added to fallback method.

src/Loader.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: The loader (last modified: 2021.08.25).
11+
* This file: The loader (last modified: 2021.09.05).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -285,11 +285,9 @@ public function __construct(
285285
$Configuration = $this->readFile($this->AssetsPath . 'config.yml')
286286
) {
287287
$Defaults = [];
288-
$this->YAML->process($Configuration, $Defaults, 0, true);
289-
if (isset($Defaults)) {
290-
$this->fallback($Defaults);
291-
$this->ConfigurationDefaults = array_merge_recursive($this->ConfigurationDefaults, $Defaults);
292-
}
288+
$this->YAML->process($Configuration, $Defaults);
289+
$this->fallback($Defaults);
290+
$this->ConfigurationDefaults = array_merge_recursive($this->ConfigurationDefaults, $Defaults);
293291
}
294292

295293
/** Register log paths. */
@@ -541,6 +539,9 @@ public function fallback(array $Fallbacks): void
541539
if (isset($Dir)) {
542540
unset($Dir);
543541
}
542+
if (!isset($Cat[$DKey])) {
543+
$Cat[$DKey] = '';
544+
}
544545
$Dir = &$Cat[$DKey];
545546
if (isset($DData['value_preg_filter']) && is_array($DData['value_preg_filter'])) {
546547
foreach ($DData['value_preg_filter'] as $FilterKey => $FilterValue) {

0 commit comments

Comments
 (0)