ZF-9312: Invalid function used in Zend_View_Helper_Doctype::isHtml5() to get the doctype

Description

I just installed the latest 1.10.2 and immediatly got this error: "{color:red}Notice: Object of class Zend_View_Helper_Doctype to string conversion in /website/bakery/library/Zend/View/Helper/Doctype.php on line 196{color}".

If you look at the code it looks like this:

public function isHtml5() {
    return (stristr($this->doctype(), '') ? true : false);
}

Function $this->doctype() returns $this and not a string. However, if you look at the function right above - isXhtml(), you will see that its code is




What I did is changed the code of isHtml5() from

to ```

Hope that helps.

Comments

==================== PHP 5.2.11 Apache 2.2.11

Windows 7

I was unable to reproduce the bug, but I've attached a patch based on the reporter's logic, just in case $this->getDoctype() was the original intention.

Andris, what version of php are you using (and what build)?