diff options
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/cookie_helper.php | 2 | ||||
-rw-r--r-- | system/helpers/html_helper.php | 2 | ||||
-rw-r--r-- | system/helpers/string_helper.php | 4 | ||||
-rw-r--r-- | system/helpers/text_helper.php | 7 |
4 files changed, 8 insertions, 7 deletions
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index d069cdb15..a1a9324ff 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -67,7 +67,7 @@ if ( ! function_exists('set_cookie')) * @param bool true makes the cookie accessible via http(s) only (no javascript) * @return void */ - function set_cookie($name, $value = '', $expire = 0, $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE) + function set_cookie($name, $value = '', $expire = 0, $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL) { // Set the config file options get_instance()->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly); diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index b5e8ed783..93ba2dd7d 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -192,7 +192,7 @@ if ( ! function_exists('img')) foreach ($src as $k => $v) { - if ($k === 'src' && ! preg_match('#^([a-z]+:)?//#i', $v)) + if ($k === 'src' && ! preg_match('#^(data:[a-z,;])|(([a-z]+:)?(?<!data:)//)#i', $v)) { if ($index_page === TRUE) { diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 311f7a420..896973704 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -168,9 +168,7 @@ if ( ! function_exists('reduce_multiples')) if ( ! function_exists('random_string')) { /** - * Create a Random String - * - * Useful for generating passwords or hashes. + * Create a "Random" String * * @param string type of random string. basic, alpha, alnum, numeric, nozero, unique, md5, encrypt and sha1 * @param int number of characters diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 07c01c3af..217729b70 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -138,7 +138,10 @@ if ( ! function_exists('ascii_to_entities')) function ascii_to_entities($str) { $out = ''; - for ($i = 0, $s = strlen($str) - 1, $count = 1, $temp = array(); $i <= $s; $i++) + $length = defined('MB_OVERLOAD_STRING') + ? mb_strlen($str, '8bit') - 1 + : strlen($str) - 1; + for ($i = 0, $count = 1, $temp = array(); $i <= $length; $i++) { $ordinal = ord($str[$i]); @@ -176,7 +179,7 @@ if ( ! function_exists('ascii_to_entities')) $temp = array(); } // If this is the last iteration, just output whatever we have - elseif ($i === $s) + elseif ($i === $length) { $out .= '&#'.implode(';', $temp).';'; } |