Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.8.1
-
Fix Version/s: 1.8.4
-
Component/s: Zend_Captcha
-
Labels:None
Description
The render() method of Zend_Captcha_Image does not return the width and height of the image captcha:
public function render(Zend_View_Interface $view, $element = null)
{
return '<img alt="'.$this->getImgAlt().'" src="' . $this->getImgUrl() . $this->getId() . $this->getSuffix() . '"/><br/>';
}
The following code does:
public function render(Zend_View_Interface $view, $element = null)
{
return '<img width="'.$this->getWidth().'" height="'.$this->getHeight().'" alt="'.$this->getImgAlt().'" src="' . $this->getImgUrl() . $this->getId() . $this->getSuffix() . '"/><br />';
}
Reasoning: "Without this information in the HTML, [the browser] cannot account for the viewport space needed for the image. As a result, it happens that if the user is reading below the image, suddenly [the browser] discovers the dimensions and the whole page jumps disconcertingly." Source: http://is.gd/Da3G)
Patch file for the fix suggested.