Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit e89de2b

Browse files
committed
only apply special case to HTML5
1 parent 10ba671 commit e89de2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Helper/HeadScript.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,11 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
400400
$addScriptEscape = !(isset($item->attributes['noescape'])
401401
&& filter_var($item->attributes['noescape'], FILTER_VALIDATE_BOOLEAN));
402402

403-
if ($item->type != '' || ($this->view && $this->view->plugin('doctype')->isXhtml())) {
403+
if (empty($item->type) && $this->view && $this->view->plugin('doctype')->isHtml5()) {
404+
$html = '<script ' . $attrString . '>';
405+
} else {
404406
$type = ($this->autoEscape) ? $this->escape($item->type) : $item->type;
405407
$html = '<script type="' . $type . '"' . $attrString . '>';
406-
} else {
407-
$html = '<script ' . $attrString . '>';
408408
}
409409
if (!empty($item->source)) {
410410
$html .= PHP_EOL;

0 commit comments

Comments
 (0)