Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.2

Bug #3271 phrase set in init is not saved
Submitted: 2005-01-23 01:53 UTC
From: justinpatrin Assigned: wenz
Status: Closed Package: Text_CAPTCHA
PHP Version: 4.3.10 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-01-23 01:53 UTC] justinpatrin
Description: ------------ Since I can't check CVS I don't know if this has been fixed yet. Please consider either putting this package in PEAR's CVS or getting your own CVS web frontend up. If a phrase is set in init(), the package correctly does not create its own phrase but also does not set the member var _phrase. These lines: if (empty($phrase)) { $this->_createPhrase(); } Should be changed to: if (empty($phrase)) { $this->_createPhrase(); } else { $this->_phrase = $phrase; } Reproduce code: --------------- function pe($err) { echo '<pre>'; print_r(debug_backtrace()); print_r($err); } PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); $cap = Text_CAPTCHA::factory('Image'); $cap->init(40, 50, '1234'); echo $cap->getCAPCTHAAsJPEG(); Expected result: ---------------- CAPTCHA with '1234' is displayed Actual result: -------------- Error: no value specified from Image_Text

Comments

 [2005-01-26 19:49 UTC] wenz
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Text_CAPTCHA thanks for the detailled report! You are right, of course. I applied your fix.