diff options
author | Adrian Voicu <avenir.ro@gmail.com> | 2015-02-05 12:51:26 +0100 |
---|---|---|
committer | Adrian Voicu <avenir.ro@gmail.com> | 2015-02-05 12:51:26 +0100 |
commit | 86e6a19eaa1f994588beee2c47143c19c800c8ec (patch) | |
tree | adf0ea312428d56aaf44a689c1b3634de98fc779 /system | |
parent | 11bf768f557e7c63f8702648705536773b37c9b8 (diff) |
Update form_helper.php
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/form_helper.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index f6d6b433e..dca4270f6 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -676,18 +676,19 @@ if ( ! function_exists('set_value')) * * @param string $field Field name * @param string $default Default value - * @param bool $escaped Escaped value + * @param bool $html_escape HTML escaped value * @return string */ - function set_value($field, $default = '',$escaped = TRUE) + function set_value($field, $default = '', $html_escape = TRUE) { $CI =& get_instance(); $value = (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field)) ? $CI->form_validation->set_value($field, $default) : $CI->input->post($field, FALSE); - $value = ($value === NULL) ? $default : $value; - return $escaped ? html_escape($value) : $value; + + isset($value) OR $value = $default; + return ($html_escape) ? html_escape($value) : $value; } } |