Skip to content

Commit

Permalink
Fix for Bug #18090: Error of loading captcha "undefined method"
Browse files Browse the repository at this point in the history
  • Loading branch information
kenguest committed Feb 19, 2013
1 parent 5528562 commit af012ed
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions HTML/QuickForm/CAPTCHA/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,37 @@ class HTML_QuickForm_CAPTCHA_Image extends HTML_QuickForm_CAPTCHA
*/
var $_CAPTCHA_driver = 'Image';

/**
* php 5.3 fix Bug #18090
*
* @param string $elementName Name
* @param mixed $elementLabel Label for the CAPTCHA
* @param array $options Options for the Text_CAPTCHA package
* <ul>
* <li>'sessionVar' (string) name of session variable containing
* the Text_CAPTCHA instance (defaults to
* _HTML_QuickForm_CAPTCHA.)</li>
* <li>Other options depend on the driver used</li>
* </ul>
* @param mixed $attributes HTML Attributes for the <a> tag surrounding
* the image. Can be a string or array.
*
* @return HTML_QuickForm_CAPTCHA_Image
*/
function HTML_QuickForm_CAPTCHA_Image(
$elementName = null,
$elementLabel = null,
$options = null,
$attributes = null
) {
parent::HTML_QuickForm_CAPTCHA(
$elementName,
$elementLabel,
$options,
$attributes
);
}

/**
* Returns the HTML for the CAPTCHA image
*
Expand Down Expand Up @@ -157,8 +188,11 @@ function getOnclickJs($imageName)
* Registers the class with QuickForm
*/
if (class_exists('HTML_QuickForm')) {
HTML_QuickForm::registerElementType('CAPTCHA_Image',
'HTML/QuickForm/CAPTCHA/Image.php', 'HTML_QuickForm_CAPTCHA_Image');
HTML_QuickForm::registerElementType(
'CAPTCHA_Image',
'HTML/QuickForm/CAPTCHA/Image.php',
'HTML_QuickForm_CAPTCHA_Image'
);
}

?>
?>

0 comments on commit af012ed

Please sign in to comment.