From a18c6097a38f7b3eac789b5c217a97d7ac0b7085 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 3 Dec 2015 17:53:14 +0200 Subject: Fix #4283 --- system/helpers/string_helper.php | 3 ++- user_guide_src/source/changelog.rst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 637835160..3138a04b3 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -270,7 +270,7 @@ if ( ! function_exists('alternator')) * @param string (as many parameters as needed) * @return string */ - function alternator($args) + function alternator() { static $i; @@ -279,6 +279,7 @@ if ( ! function_exists('alternator')) $i = 0; return ''; } + $args = func_get_args(); return $args[($i++ % count($args))]; } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 5b7f225a5..a7807aa03 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -16,12 +16,13 @@ Bug fixes for 3.0.4 ------------------- - Fixed a bug (#4212) - :doc:`Query Builder ` method ``count_all_results()`` could fail if an ``ORDER BY`` condition is used. -- Fixed a bug where :doc:`Form Helper ` functions `set_checkbox()`, `set_radio()` didn't "uncheck" inputs on a submitted form if the default state is "checked". +- Fixed a bug where :doc:`Form Helper ` functions :php:func:`set_checkbox()`, :php:func:`set_radio()` didn't "uncheck" inputs on a submitted form if the default state is "checked". - Fixed a bug (#4217) - :doc:`Config Library ` 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 ` entered an infinite loop while generating a random string. - Fixed a bug (#4223) - :doc:`Database ` method ``simple_query()`` blindly executes queries without checking if the connection was initialized properly. - Fixed a bug (#4244) - :doc:`Email Library ` could improperly use "unsafe" US-ASCII characters during Quoted-printable encoding. - Fixed a bug (#4245) - :doc:`Database Forge ` couldn't properly handle ``SET`` and ``ENUM`` type fields with string values. +- Fixed a bug (#4283) - :doc:`String Helper ` function :php:func:`alternator()` couldn't be called without arguments. Version 3.0.3 ============= -- cgit v1.2.3-24-g4f1b