Skip to content

Commit 8a9cc9a

Browse files
sreichelPascal Querner
authored andcommitted
update
1 parent 99794ba commit 8a9cc9a

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,8 @@ protected function getConfigKey(string $configKey): array
264264

265265
unset($configKeyParts[0]);
266266

267+
/** @var string $scope */
267268
$scope = array_shift($configKeyParts);
268-
if (!is_string($scope)) {
269-
throw new Mage_Core_Exception(
270-
'Invalid configuration key: ' . $configKey . '. Scope is not a string.',
271-
);
272-
}
273269

274270
return [$configKeyParts, $scope];
275271
}
@@ -288,14 +284,7 @@ protected function isConfigKeyValid(string $configKey): bool
288284
. self::ENV_KEY_SEPARATOR . $sectionGroupFieldRegexp . '/';
289285
// /OPENMAGE_CONFIG__(WEBSITES__[A-Z-_]+|DEFAULT|STORES__[A-Z-_]+)__([A-Z-_]*)__([A-Z-_]*)__([A-Z-_]*)/
290286

291-
$validatedConfigKey = preg_match($regexp, $configKey);
292-
if ($validatedConfigKey === false) {
293-
throw new Mage_Core_Exception(
294-
'Invalid configuration key: ' . $configKey . '. Regex match failed.',
295-
);
296-
}
297-
298-
return (bool) $validatedConfigKey;
287+
return (bool) preg_match($regexp, $configKey);
299288
}
300289

301290
/**

0 commit comments

Comments
 (0)