From 9708855b4c2e5f6c75403da5aa0c07247518ab64 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 8 Feb 2013 21:53:20 +0200 Subject: Allow non-string values to be used as captcha words (issue #2215) --- system/helpers/captcha_helper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'system/helpers') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 83783324b..78e255a15 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -93,7 +93,7 @@ if ( ! function_exists('create_captcha')) // Do we have a "word" yet? // ----------------------------------- - if ($word === '') + if (empty($word)) { $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $word = ''; @@ -102,6 +102,10 @@ if ( ! function_exists('create_captcha')) $word .= $pool[mt_rand(0, $mt_rand_max)]; } } + elseif ( ! is_string($word)) + { + $word = (string) $word; + } // ----------------------------------- // Determine angle and position -- cgit v1.2.3-24-g4f1b