summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/helpers/captcha_helper.php3
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 3 insertions, 1 deletions
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 85bcfb5a0..03c1dd852 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -171,7 +171,8 @@ if ( ! function_exists('create_captcha'))
$byte_index = $word_index = 0;
while ($word_index < $word_length)
{
- if (($rand_index = unpack('C', $bytes[$byte_index++])) > $rand_max)
+ list(, $rand_index) = unpack('C', $bytes[$byte_index++]);
+ if ($rand_index > $rand_max)
{
// Was this the last byte we have?
// If so, try to fetch more.
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index cb955e833..cdde4fa94 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -13,6 +13,7 @@ Bug fixes for 3.0.4
- Fixed a bug (#4212) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` could fail if an ``ORDER BY`` condition is used.
- Fixed a bug where :doc:`Form Helper <helpers/form_helper>` functions `set_checkbox()`, `set_radio()` didn't "uncheck" inputs on a submitted form if the default state is "checked".
- Fixed a bug (#4217) - :doc:`Config Library <libraries/config>` method ``base_url()`` didn't use proper formatting for IPv6 when it falls back to ``$_SERVER['SERVER_ADDR']``.
+- Fixed a bug where :doc:`CAPTCHA Helper <helpers/captcha_helper>` entered an infinite loop while generating a random string.
Version 3.0.3
=============