CAPTCHA plugin with captcha_php backend and PHP 5.4 - no image
"Boyan B. Boychev" <[email protected]> Sun, 20 Jan 2013 17:40:02 +0200
| Newsgroups | gmane.mail.squirrelmail.plugins |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I think I found a small issue with CAPTCHA plugin with captcha_php backend
using PHP 5.4.x. The issue is that the captcha image does not display on
the login page. The error in the apache error log:
-----------------------------------------------------------------------------
[Sun Jan 20 16:37:12 2013] [error] [client X.X.X.X] PHP Warning:
imagejpeg(): Filename cannot be empty in
<SQUIRRELMAIL_HOME_DIR_PATH>/plugins/captcha/backends/captcha_php/captcha.php
on line 328
-----------------------------------------------------------------------------
I didn't have the issue with PHP 5.3.x. It seems that the imagejpeg()
function behaviour has been changed with PHP 5.4.x.
The fix is simple (edit line 328 in
<SQUIRRELMAIL_HOME_DIR_PATH>/plugins/captcha/backends/captcha_php/captcha.php):
----------------------------------------------
from: imagejpeg($img, "", (int)$quality);
to: imagejpeg($img, NULL, (int)$quality);
----------------------------------------------
Probably this could be fixed in the next version of captch plugin if the
author thinks that's an issue. I am not sure if it will work with PHP
5.3.x or lower.
Thanks & Best Regards,
Boyan Boychev
SquirrelMail 1.4.22
PHP Version 5.4.8--pl0-gentoo
GD Version bundled (2.0.34 compatible)
CAPTCHA 1.2.3
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
-----
squirrelmail-plugins mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins