From 8cc0cfe1ab1e10aad71d14e0b43e05444c00693d Mon Sep 17 00:00:00 2001 From: freewil Date: Sat, 27 Aug 2011 21:53:00 -0400 Subject: always use charset config item --- system/helpers/typography_helper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'system/helpers/typography_helper.php') diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 19b4eec03..0bb0938a4 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -82,9 +82,12 @@ if ( ! function_exists('auto_typography')) */ if ( ! function_exists('entity_decode')) { - function entity_decode($str, $charset='UTF-8') + function entity_decode($str, $charset = NULL) { global $SEC; + + if (empty($charset)) $charset = config_item('charset'); + return $SEC->entity_decode($str, $charset); } } -- cgit v1.2.3-24-g4f1b From 5c9b0d1b5618ade5c6aa70475b08b3066f14ff3e Mon Sep 17 00:00:00 2001 From: freewil Date: Sun, 28 Aug 2011 12:15:23 -0400 Subject: always use charset config item --- system/helpers/typography_helper.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'system/helpers/typography_helper.php') diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 0bb0938a4..82e686e53 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -39,9 +39,7 @@ if ( ! function_exists('nl2br_except_pre')) function nl2br_except_pre($str) { $CI =& get_instance(); - $CI->load->library('typography'); - return $CI->typography->nl2br_except_pre($str); } } @@ -86,7 +84,10 @@ if ( ! function_exists('entity_decode')) { global $SEC; - if (empty($charset)) $charset = config_item('charset'); + if (empty($charset)) + { + $charset = config_item('charset'); + } return $SEC->entity_decode($str, $charset); } -- cgit v1.2.3-24-g4f1b From 91f00f0d14dc0614f0f2263ff940d6693a21fb4e Mon Sep 17 00:00:00 2001 From: freewil Date: Wed, 28 Sep 2011 22:10:44 -0400 Subject: remove redundant 'if' in typography helper --- system/helpers/typography_helper.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'system/helpers/typography_helper.php') diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 82e686e53..d5b52a810 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -83,12 +83,6 @@ if ( ! function_exists('entity_decode')) function entity_decode($str, $charset = NULL) { global $SEC; - - if (empty($charset)) - { - $charset = config_item('charset'); - } - return $SEC->entity_decode($str, $charset); } } -- cgit v1.2.3-24-g4f1b From 70037f3fb92937766fcd14ff950f2ce9970722c3 Mon Sep 17 00:00:00 2001 From: freewil Date: Wed, 28 Sep 2011 22:16:48 -0400 Subject: add missing @param tag --- system/helpers/typography_helper.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/helpers/typography_helper.php') diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index d5b52a810..e8cb037a8 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -76,6 +76,7 @@ if ( ! function_exists('auto_typography')) * * @access public * @param string + * @param string * @return string */ if ( ! function_exists('entity_decode')) -- cgit v1.2.3-24-g4f1b