summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2019-10-08 09:19:20 +0200
committerAndrey Andreev <narf@devilix.net>2019-10-08 09:28:47 +0200
commit736592a8c452c6b13adfa4d16ff5f9d7078bd3b0 (patch)
tree03ddaf83ea671e80b12e53b85a58da8aa1ac7dc9 /system/helpers
parent74a87aef6545755c873308290d9605efe9a01c86 (diff)
Merge pull request #5832 from gxgpet/develop
Improve create_captcha()'s logging Conflicts resolved: system/helpers/captcha_helper.php
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/captcha_helper.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 37ef04b24..5252d417c 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -94,10 +94,21 @@ if ( ! function_exists('create_captcha'))
}
}
- if ($img_path === '' OR $img_url === ''
- OR ! is_dir($img_path) OR ! is_really_writable($img_path)
- OR ! extension_loaded('gd'))
+ if ( ! extension_loaded('gd'))
{
+ log_message('error', 'create_captcha(): GD extension is not loaded.');
+ return FALSE;
+ }
+
+ 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;
}