summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2019-10-08 09:19:20 +0200
committerGitHub <noreply@github.com>2019-10-08 09:19:20 +0200
commit93276e96f1e308a870ce3fe0fd8300b5972620a6 (patch)
tree06fad1bf04cee1bd379eb2ce0e605070c91af378 /system
parent58363c5f0df3cba6aa40bbc43ac28ad735e74a4f (diff)
parentfa5ab87854124729e83b33470fec1030a61d1b97 (diff)
Merge pull request #5832 from gxgpet/develop
Improve create_captcha()'s logging
Diffstat (limited to 'system')
-rw-r--r--system/helpers/captcha_helper.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 94365adb5..642ff3a50 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -99,13 +99,21 @@ if ( ! function_exists('create_captcha'))
if ( ! extension_loaded('gd'))
{
+ log_message('error', 'create_captcha(): GD extension is not loaded.');
return FALSE;
}
if ($img_url !== '' OR $img_path !== '')
{
- if ($img_path === '' OR $img_url === '' OR ! is_dir($img_path) OR ! is_really_writable($img_path))
+ if ($img_path === '' OR $img_url === '')
{
+ log_message('error', 'create_captcha(): $img_path and $img_url are required.');
+ return FALSE;
+ }
+
+ if ( ! is_dir($img_path) OR ! is_really_writable($img_path))
+ {
+ log_message('error', "create_captcha(): '{$img_path}' is not a dir, nor is it writable.");
return FALSE;
}