diff options
author | Ahmad Anbar <aanbar@gmail.com> | 2015-02-08 17:29:52 +0100 |
---|---|---|
committer | Ahmad Anbar <aanbar@gmail.com> | 2015-02-08 17:29:52 +0100 |
commit | ed520408514fff6486788e1543589418d24d885e (patch) | |
tree | 07fd3194e9c6baf7aeaa9ccdd164e3fec4494922 /system/helpers | |
parent | e5454f9b28f123a5549971f580255a065b2f8cc2 (diff) | |
parent | 266c93cc505ae9a8cafb41f9d9432b056de492e0 (diff) |
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/download_helper.php | 8 | ||||
-rw-r--r-- | system/helpers/form_helper.php | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 379120552..95c94a1b8 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -65,7 +65,7 @@ if ( ! function_exists('force_download')) { if ($filename === '' OR $data === '') { - return FALSE; + return; } elseif ($data === NULL) { @@ -77,7 +77,7 @@ if ( ! function_exists('force_download')) } else { - return FALSE; + return; } } else @@ -98,7 +98,7 @@ if ( ! function_exists('force_download')) /* If we're going to detect the MIME type, * we'll need a file extension. */ - return FALSE; + return; } // Load the mime types @@ -125,7 +125,7 @@ if ( ! function_exists('force_download')) if ($data === NULL && ($fp = @fopen($filepath, 'rb')) === FALSE) { - return FALSE; + return; } // Clean output buffer 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; } } |