summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2013-02-08 20:53:20 +0100
committerAndrey Andreev <narf@bofh.bg>2013-02-08 20:53:20 +0100
commit9708855b4c2e5f6c75403da5aa0c07247518ab64 (patch)
treedaf7c1d1f4d8f3ee3e69a60056abf470a4c239bc
parent46d31b748e20ec1798987b1d3b4e27765ff93fbb (diff)
Allow non-string values to be used as captcha words (issue #2215)
-rw-r--r--system/helpers/captcha_helper.php6
1 files changed, 5 insertions, 1 deletions
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