ZF-3124: Calling a non-static function from a static context in Zend_Feed
Description
This bug is very easy to fix and should take only a few secs. But I don't know how to create a patch. Zend_Feed.php attempts to call DOMDocument load XML method without first instantiating a new instance.
Feed.php[195] E_STRICT: Non-static method DOMDocument::loadXML() should not be called statically
The fix:
* @throws Zend_Feed_Exception
* @return Zend_Feed_Abstract
*/
public static function importString($string)
{
// Load the feed as an XML DOMDocument object
@ini_set('track_errors', 1);
{color:red} $doc = new DOMDocument();{color}
@$doc->loadXML($string);
@ini_restore('track_errors');
Abstract.php[113] E_STRICT: Non-static method DOMDocument::loadXML() should not be called statically, assuming $this from incompatible context The fix:
public function __wakeup()
{
@ini_set('track_errors', 1);
{color:red} $doc = new DOMDocument();{color}
@$doc->loadXML($this->_element);
@ini_restore('track_errors');
Comments
Posted by Wil Sinclair (wil) on 2008-04-18T13:25:24.000+0000
Please evaluate and categorize as necessary.
Posted by Benjamin Eberlei (beberlei) on 2008-11-07T05:28:48.000+0000
Was fixed by matthew in r10380.
Posted by Wil Sinclair (wil) on 2008-11-13T14:10:13.000+0000
Changing issues in preparation for the 1.7.0 release.