diff --git a/library/Zend/Feed/Element.php b/library/Zend/Feed/Element.php index 44b2468ef4..c4999c26b1 100644 --- a/library/Zend/Feed/Element.php +++ b/library/Zend/Feed/Element.php @@ -134,8 +134,8 @@ protected function ensureAppended() public function saveXml() { // Return a complete document including XML prologue. - $doc = new DOMDocument($this->_element->ownerDocument->version, - $this->_element->ownerDocument->actualEncoding); + $doc = new DOMDocument((string) $this->_element->ownerDocument->version, + (string) $this->_element->ownerDocument->actualEncoding); $doc->appendChild($doc->importNode($this->_element, true)); return $doc->saveXML(); } diff --git a/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php b/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php index 74c59798d5..ba4233ecf1 100644 --- a/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php +++ b/library/Zend/Feed/Pubsubhubbub/Model/Subscription.php @@ -114,7 +114,7 @@ public function hasSubscription($key) .' of "' . $key . '" must be a non-empty string'); } $result = $this->_db->find($key); - if (count($result)) { + if (count($result ?? [])) { return true; } return false; diff --git a/library/Zend/Feed/Reader/Entry/Rss.php b/library/Zend/Feed/Reader/Entry/Rss.php index 57c00a141b..90c4161b10 100644 --- a/library/Zend/Feed/Reader/Entry/Rss.php +++ b/library/Zend/Feed/Reader/Entry/Rss.php @@ -193,7 +193,7 @@ public function getAuthors() } } - if (count($authors) === 0) { + if (count($authors ?? []) === 0) { $authors = $this->getExtension('Atom')->getAuthors(); } else { $authors = new Zend_Feed_Reader_Collection_Author( @@ -201,7 +201,7 @@ public function getAuthors() ); } - if (count($authors) === 0) { + if (count($authors ?? []) === 0) { $authors = null; } diff --git a/library/Zend/Feed/Reader/Extension/Atom/Entry.php b/library/Zend/Feed/Reader/Extension/Atom/Entry.php index 6001320051..d1c5429ff2 100644 --- a/library/Zend/Feed/Reader/Extension/Atom/Entry.php +++ b/library/Zend/Feed/Reader/Extension/Atom/Entry.php @@ -163,7 +163,7 @@ public function getContent() $content = $this->getDescription(); } - $this->_data['content'] = trim($content); + $this->_data['content'] = trim((string) $content); return $this->_data['content']; } diff --git a/library/Zend/Feed/Reader/Feed/Rss.php b/library/Zend/Feed/Reader/Feed/Rss.php index 7f87343525..e339817e9f 100644 --- a/library/Zend/Feed/Reader/Feed/Rss.php +++ b/library/Zend/Feed/Reader/Feed/Rss.php @@ -143,7 +143,7 @@ public function getAuthors() } } - if (count($authors) === 0) { + if (count($authors ?? []) === 0) { $authors = $this->getExtension('Atom')->getAuthors(); } else { $authors = new Zend_Feed_Reader_Collection_Author( @@ -151,7 +151,7 @@ public function getAuthors() ); } - if (count($authors) === 0) { + if (count($authors ?? []) === 0) { $authors = null; }