Skip to content

Commit

Permalink
fix: Deprecated: htmlspecialchars(): Passing null to parameter Shardj#1
Browse files Browse the repository at this point in the history
… ($string) of type string is deprecated
  • Loading branch information
staniol007 committed May 24, 2022
1 parent 518ac42 commit f13745f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/Zend/View/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,10 @@ public function render($name)
public function escape($var)
{
if (in_array($this->_escape, ['htmlspecialchars', 'htmlentities'])) {
if ($this->_escape == 'htmlspecialchars' && $var === null) {
return null;
}

return call_user_func($this->_escape, $var, ENT_COMPAT, $this->_encoding);
}

Expand Down

0 comments on commit f13745f

Please sign in to comment.