ZF-11483: Zend_Captcha_Image does not repect doctype when producing image tag

Issue Type: Bug Created: 2011-06-15T07:24:34.000+0000 Last Updated: 2011-06-15T13:18:16.000+0000 Status: Resolved Fix version(s): - 1.11.8 (07/Jul/11)

Reporter: Włodzimierz Gajda (gajdaw) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Captcha

Related issues: Attachments:


Method Zend_Captcha_Image::render() doest not take into account view's settings and produces always XHTML tag:

<pre class="highlight">

Here is fragment of Zend_Captcha_Image::render() method:

<pre class="highlight">
public function render(Zend_View_Interface $view = null, $element = null)
    return '';

I think we should use something of the kind:

<pre class="highlight">
// XHTML or HTML end tag?
$endTag = ' />';
if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
    $endTag= '>';

return '

Of course we need access to current view.


Posted by Adam Lundrigan (adamlundrigan) on 2011-06-15T13:16:52.000+0000

Submitter has no CLA on file, so I borrowed the code in commited fix from another view helper (Zend_View_Helper_FormImage) to avoid any issues.

Fixed in trunk r24145 Merged to release-1.11 in r24146

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.