Zend Framework

Zend_Captcha_Image without "width" and "height" attributes

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor 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)

Activity

Hide
Romain Fromi added a comment -

Patch file for the fix suggested.

Show
Romain Fromi added a comment - Patch file for the fix suggested.
Hide
Stanislav Malyshev added a comment -

fixed, thanks

Show
Stanislav Malyshev added a comment - fixed, thanks

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: