diff options
-rw-r--r-- | system/helpers/form_helper.php | 3 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 531ab66c0..263dc0f19 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -229,6 +229,9 @@ function form_dropdown($name = '', $options = array(), $selected = '', $extra = foreach ($options as $key => $val)
{
+ $key = (string) $key;
+ $val = (string) $val;
+
$sel = ($selected != $key) ? '' : ' selected="selected"';
$form .= '<option value="'.$key.'"'.$sel.'>'.$val."</option>\n";
diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 67baae43e..fbcbc544e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -90,6 +90,7 @@ Change Log <li>Modified the is_image() method in the Upload library to take into account Windows IE 6/7 eccentricities when dealing with MIMEs</li>
<li>Modified XSS Cleaning routine to be more performance friendly and compatible with PHP 5.2's new PCRE backtrack and recursion limits.</li>
<li>Modified the URL Helper to type cast the $title as a string in case a numeric value is supplied</li>
+ <li>Modified Form Helper form_dropdown() to type cast the keys and values of the options array as strings, allowing numeric values to be properly set as 'selected'</li>
<li>Deprecated the use if <kbd>is_numeric()</kbd> in various places since it allows periods. Due to compatibility problems with <kbd>ctype_digit()</kbd>, making it unreliable in some installations, the following regular expression was used instead: <kbd>preg_match("/[^0-9]/", $n)</kbd></li>
<li>Deprecated: APPVER has been deprecated and replaced with CI_VERSION for clarity. </li>
</ul>
|