diff options
author | Andrey Andreev <narf@devilix.net> | 2014-08-10 23:09:52 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-08-10 23:09:52 +0200 |
commit | 8aedf238c1b6f5fec953830f4c5a1eca65fe0b73 (patch) | |
tree | 8fa4a9394fb7c4ef223e319bdfdd5eac3215d066 /system | |
parent | 345478b8b746ac2e64def739a78b053eebc68c64 (diff) | |
parent | 6854f87c384b2bcf549b9040413052ed67c3038b (diff) |
Merge pull request #3173 from ET-NiK/develop
Using ImagePNG in CAPTCHA helper
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/captcha_helper.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 74ab24ffb..36a53749f 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -216,8 +216,22 @@ if ( ! function_exists('create_captcha')) // Generate the image // ----------------------------------- $img_url = rtrim($img_url, '/').'/'; - $img_filename = $now.'.jpg'; - ImageJPEG($im, $img_path.$img_filename); + + if (function_exists('ImageJPEG')) + { + $img_filename = $now.'.jpg'; + ImageJPEG($im, $img_path.$img_filename); + } + elseif (function_exists('ImagePNG')) + { + $img_filename = $now.'.png'; + ImagePNG($im, $img_path.$img_filename); + } + else + { + return FALSE; + } + $img = '<img src="'.$img_url.$img_filename.'" style="width: '.$img_width.'; height: '.$img_height .'; border: 0;" alt=" " />'; ImageDestroy($im); |