Skip to content

Commit

Permalink
Merge pull request #16 from Leuchtfeuer/bugfix/ensure_language_is_set…
Browse files Browse the repository at this point in the history
…_20240411233

[TASK] Ensure language array is set
  • Loading branch information
bmgrieger committed Apr 16, 2024
2 parents 8c3c5bc + a299c55 commit 1767bde
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Classes/EventListener/CdnEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ public function __construct()
break;
}
}

if (count($language) === 0 && $site = reset($allSites)) {
// if no site matches, get the first as default
$languages = $site->getAttribute('languages');
$language = reset($languages);
}
}

$replacer = $GLOBALS['TSFE']->config['config']['tx_awstools.']['replacer.'] ?? [];
$this->responsible = filter_var($language['awstools_cdn_enabled'], FILTER_VALIDATE_BOOLEAN) === true && !empty($language['awstools_cdn_host'] && $replacer['eventListener'] === '1');
$this->responsible = isset($language['awstools_cdn_enabled']) && filter_var($language['awstools_cdn_enabled'], FILTER_VALIDATE_BOOLEAN) === true && !empty($language['awstools_cdn_host'] && $replacer['eventListener'] === '1');

if ($this->responsible) {
$this->host = $language['awstools_cdn_host'];
Expand Down

0 comments on commit 1767bde

Please sign in to comment.