diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php index 532974e2000f821c1b19c15ceb8f8690ab055b68..bbc8eac0e4bb670b32f9c89ac6904d7fe7132ae9 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php @@ -56,7 +56,7 @@ class CssViewHelper extends AbstractTagBasedViewHelper parent::registerUniversalTagAttributes(); $this->registerTagAttribute('as', 'string', '', false); $this->registerTagAttribute('crossorigin', 'string', '', false); - $this->registerTagAttribute('disabled', 'string', '', false); + $this->registerTagAttribute('disabled', 'bool', '', false); $this->registerTagAttribute('href', 'string', '', false); $this->registerTagAttribute('hreflang', 'string', '', false); $this->registerTagAttribute('importance', 'string', '', false); @@ -86,6 +86,12 @@ class CssViewHelper extends AbstractTagBasedViewHelper { $identifier = (string)$this->arguments['identifier']; $attributes = $this->tag->getAttributes(); + + // boolean attributes shall output attr="attr" if set + if ($attributes['disabled'] ?? false) { + $attributes['disabled'] = 'disabled'; + } + $file = $this->tag->getAttribute('href'); unset($attributes['href']); $options = [ diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php index 086c7f8d1299069ac69f6436407d2943690a1fa1..a411d117ef12952244ed851dc6041e7b53f608eb 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php @@ -54,11 +54,11 @@ class ScriptViewHelper extends AbstractTagBasedViewHelper { parent::initializeArguments(); parent::registerUniversalTagAttributes(); - $this->registerTagAttribute('async', 'string', '', false); + $this->registerTagAttribute('async', 'bool', '', false); $this->registerTagAttribute('crossorigin', 'string', '', false); - $this->registerTagAttribute('defer', 'string', '', false); + $this->registerTagAttribute('defer', 'bool', '', false); $this->registerTagAttribute('integrity', 'string', '', false); - $this->registerTagAttribute('nomodule', 'string', '', false); + $this->registerTagAttribute('nomodule', 'bool', '', false); $this->registerTagAttribute('nonce', 'string', '', false); $this->registerTagAttribute('referrerpolicy', 'string', '', false); $this->registerTagAttribute('src', 'string', '', false); @@ -82,6 +82,14 @@ class ScriptViewHelper extends AbstractTagBasedViewHelper { $identifier = (string)$this->arguments['identifier']; $attributes = $this->tag->getAttributes(); + + // boolean attributes shall output attr="attr" if set + foreach (['async', 'defer', 'nomodule'] as $_attr) { + if ($attributes[$_attr] ?? false) { + $attributes[$_attr] = $_attr; + } + } + $src = $this->tag->getAttribute('src'); unset($attributes['src']); $options = [