diff options
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r-- | system/helpers/form_helper.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index fb235291e..53ee8eb11 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -676,9 +676,10 @@ if ( ! function_exists('set_value')) * * @param string $field Field name * @param string $default Default value + * @param bool $html_escape Whether to escape HTML special characters or not * @return string */ - function set_value($field, $default = '') + function set_value($field, $default = '', $html_escape = TRUE) { $CI =& get_instance(); @@ -686,7 +687,8 @@ if ( ! function_exists('set_value')) ? $CI->form_validation->set_value($field, $default) : $CI->input->post($field, FALSE); - return html_escape($value === NULL ? $default : $value); + isset($value) OR $value = $default; + return ($html_escape) ? html_escape($value) : $value; } } |