From 98baf38d5384b316fc443f764d01041c8912d31e Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 8 Sep 2019 15:58:36 +0300 Subject: improve create_captcha logging --- system/helpers/captcha_helper.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'system') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 94365adb5..ca9b86540 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -99,13 +99,19 @@ 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; + } elseif ( ! is_dir($img_path) OR ! is_really_writable($img_path)) + { + log_message('error', "create_captcha(): '$img_path' is not a dir, nor it's writable."); return FALSE; } -- cgit v1.2.3-24-g4f1b From 25931b0d5e639cf48dd8488b46975787ee5e5ed2 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 22 Sep 2019 20:56:55 +0300 Subject: if+elseif => if + if --- system/helpers/captcha_helper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index ca9b86540..4552225ef 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -109,7 +109,9 @@ if ( ! function_exists('create_captcha')) { log_message('error', 'create_captcha(): "img_path" and "img_url" are required.'); return FALSE; - } elseif ( ! is_dir($img_path) OR ! is_really_writable($img_path)) + } + + if ( ! is_dir($img_path) OR ! is_really_writable($img_path)) { log_message('error', "create_captcha(): '$img_path' is not a dir, nor it's writable."); return FALSE; -- cgit v1.2.3-24-g4f1b From 24ff922ccb2cd647f997a7bc074d8863ea34fb10 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 22 Sep 2019 20:57:54 +0300 Subject: adding $img_path in curly; fixing words order --- system/helpers/captcha_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 4552225ef..a71148c97 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -113,7 +113,7 @@ if ( ! function_exists('create_captcha')) if ( ! is_dir($img_path) OR ! is_really_writable($img_path)) { - log_message('error', "create_captcha(): '$img_path' is not a dir, nor it's writable."); + log_message('error', "create_captcha(): '{$img_path}' is not a dir, nor is it writable."); return FALSE; } -- cgit v1.2.3-24-g4f1b From 6c6742cfe6b259e4e675b77c5e42c4e21dbd5104 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 22 Sep 2019 21:04:41 +0300 Subject: adding $ to var names in the log message --- system/helpers/captcha_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index a71148c97..1d87b80e5 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -107,7 +107,7 @@ if ( ! function_exists('create_captcha')) { if ($img_path === '' OR $img_url === '') { - log_message('error', 'create_captcha(): "img_path" and "img_url" are required.'); + log_message('error', 'create_captcha(): "$img_path" and "$img_url" are required.'); return FALSE; } -- cgit v1.2.3-24-g4f1b From fa5ab87854124729e83b33470fec1030a61d1b97 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Tue, 8 Oct 2019 10:11:47 +0300 Subject: removes double quotes --- system/helpers/captcha_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 1d87b80e5..642ff3a50 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -107,7 +107,7 @@ if ( ! function_exists('create_captcha')) { if ($img_path === '' OR $img_url === '') { - log_message('error', 'create_captcha(): "$img_path" and "$img_url" are required.'); + log_message('error', 'create_captcha(): $img_path and $img_url are required.'); return FALSE; } -- cgit v1.2.3-24-g4f1b