Skip to content

Commit

Permalink
Merge pull request #24 from sandstorm/23-exception-for-paths-being-re…
Browse files Browse the repository at this point in the history
…solved-as-array

BUGFIX: prevent array from being passed to ConfigurationHelper
  • Loading branch information
fheinze authored May 2, 2023
2 parents 75ef1f4 + b5ae644 commit 53503ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Eel/Helper/CookiePunchConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ public function translate($path): ?string
{
if ($path) {
$settingsValue = (new ConfigurationHelper())->setting($path);
if ($settingsValue) {
// we need to prevent an array to be passed to the TranslationHelper
// this can happen when we e.g. try to translate "Sandstorm", which will
// return the corresponding yaml config
if ($settingsValue && is_string($settingsValue)) {
return (new TranslationHelper())->translate($settingsValue);
} else {
return (new TranslationHelper())->translate($path);
Expand Down

0 comments on commit 53503ff

Please sign in to comment.