Skip to content

Commit

Permalink
Fix Calling doctype() on null
Browse files Browse the repository at this point in the history
Signed-off-by: Elan Ruusamäe <[email protected]>
  • Loading branch information
Gui-Rong Ko authored and falkenhawk committed Feb 25, 2024
1 parent 256e43f commit 2406a4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/zend-view/library/Zend/View/Helper/HeadScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
$addScriptEscape = !(isset($item->attributes['noescape']) && filter_var($item->attributes['noescape'], FILTER_VALIDATE_BOOLEAN));

$type = ($this->_autoEscape) ? $this->_escape($item->type) : $item->type;
if ($this->view->doctype()->isHtml5() && $type === 'text/javascript') {
if ($isHTML5 && $type === 'text/javascript') {
$html = '<script' . $attrString . '>';
} else {
$html = '<script type="' . $type . '"' . $attrString . '>';
Expand Down

0 comments on commit 2406a4e

Please sign in to comment.