From 736592a8c452c6b13adfa4d16ff5f9d7078bd3b0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 8 Oct 2019 10:19:20 +0300 Subject: Merge pull request #5832 from gxgpet/develop Improve create_captcha()'s logging Conflicts resolved: system/helpers/captcha_helper.php --- system/helpers/captcha_helper.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'system') 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; } -- cgit v1.2.3-24-g4f1b