From b5a491cf8a28f1ff616c8f660ef6d6e13111154a Mon Sep 17 00:00:00 2001 From: Eugene Date: Tue, 11 Jan 2022 22:07:40 +0200 Subject: [PATCH] PHP 8.1 PHP Deprecated: - strtr(): Passing null to parameter #1 ($string) of type string is deprecated - PDOStatement::fetch(): Passing null to parameter #3 ($cursorOffset) of type int is deprecated - PDOStatement::fetch(): Passing null to parameter #2 ($cursorOrientation) of type int is deprecated --- library/Zend/Db/Statement/Pdo.php | 2 +- library/Zend/Mail.php | 3 +++ library/Zend/View/Abstract.php | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/library/Zend/Db/Statement/Pdo.php b/library/Zend/Db/Statement/Pdo.php index b22b85b896..4c95b8cdd4 100644 --- a/library/Zend/Db/Statement/Pdo.php +++ b/library/Zend/Db/Statement/Pdo.php @@ -245,7 +245,7 @@ public function _execute(array $params = null) * @return mixed Array, object, or scalar depending on fetch mode. * @throws Zend_Db_Statement_Exception */ - public function fetch($style = null, $cursor = null, $offset = null) + public function fetch($style = null, $cursor = PDO::FETCH_ORI_NEXT, $offset = 0) { if ($style === null) { $style = $this->_fetchMode; diff --git a/library/Zend/Mail.php b/library/Zend/Mail.php index e73953fa09..f7ce6a68c5 100644 --- a/library/Zend/Mail.php +++ b/library/Zend/Mail.php @@ -1231,6 +1231,9 @@ protected function _filterEmail($email) */ protected function _filterName($name) { + if(is_null($name)) { + return null; + } $rule = ["\r" => '', "\n" => '', "\t" => '', diff --git a/library/Zend/View/Abstract.php b/library/Zend/View/Abstract.php index b27c02ea41..a35d4c451e 100644 --- a/library/Zend/View/Abstract.php +++ b/library/Zend/View/Abstract.php @@ -900,6 +900,9 @@ public function render($name) */ public function escape($var) { + if(is_null($var)) { + return null; + } if (in_array($this->_escape, ['htmlspecialchars', 'htmlentities'])) { return call_user_func($this->_escape, $var, ENT_COMPAT, $this->_encoding); }