From 7b3be2fbcf62791918be5fe6d5c42eb005eb7342 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 11 Jan 2011 08:52:09 -0500 Subject: Changed || to OR to match coding standards --- system/helpers/inflector_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers') diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 3d9acfcf0..88f48d48e 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -93,7 +93,7 @@ if ( ! function_exists('plural')) } elseif ($end == 'h') { - if (substr($str, -2) == 'ch' || substr($str, -2) == 'sh') + if (substr($str, -2) == 'ch' OR substr($str, -2) == 'sh') { $str .= 'es'; } -- cgit v1.2.3-24-g4f1b From 5e04480e5a4dd1b9b639eca54f5f3adbd0b39039 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 11 Jan 2011 16:10:26 -0500 Subject: Reworked convert_foreign_characters in text helper. Thanks to Mario Ricalde. --- system/helpers/text_helper.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 58b08aaf8..9194b577d 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -364,30 +364,21 @@ if ( ! function_exists('highlight_phrase')) */ if ( ! function_exists('convert_accented_characters')) { - function convert_accented_characters($match) + function convert_accented_characters($str) { if ( ! file_exists(APPPATH.'config/foreign_chars'.EXT)) { - return $match; + return $str; } include APPPATH.'config/foreign_chars'.EXT; if ( ! isset($foreign_characters)) { - return $match; + return $str; } - $ord = ord($match['1']); - - if (isset($foreign_characters[$ord])) - { - return $foreign_characters[$ord]; - } - else - { - return $match['1']; - } + return preg_replace(array_keys($foreign_characters), array_values($foreign_characters), $str); } } -- cgit v1.2.3-24-g4f1b