Update src/View/Requirements_Backend.php

Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
This commit is contained in:
Finlay Metcalfe 2023-12-14 11:24:27 +13:00 committed by GitHub
parent cadd3b1322
commit 3573484e9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 12 deletions

View File

@ -830,18 +830,9 @@ class Requirements_Backend
// Add all inline JavaScript *after* including external files they might rely on
foreach ($this->getCustomScripts() as $key => $script) {
// Build html attributes
$curScriptAttributes = null;
if (array_key_exists($key, $this->customScriptAttributes)) {
$curScriptAttributes = $this->customScriptAttributes[$key];
}
$customHtmlAttributes = [
'type' => 'application/javascript'
];
if (isset($curScriptAttributes)) {
$customHtmlAttributes['type'] = $curScriptAttributes['type'];
if (!empty($curScriptAttributes['crossorigin'])) {
$customHtmlAttributes['crossorigin'] = $curScriptAttributes['crossorigin'];
}
$customHtmlAttributes = ['type' => 'application/javascript'];
foreach ($this->customScriptAttributes[$key] as $attrKey => $attrValue) {
$customHtmlAttributes[$attrKey] = $attrValue;
}
$jsRequirements .= HTML::createTag(
'script',