diff options
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/inflector_helper.php | 2 | ||||
-rw-r--r-- | system/helpers/text_helper.php | 17 |
2 files changed, 5 insertions, 14 deletions
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index ed9ab5f9d..4cd7486b4 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'; } diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index e1b56c9c9..47e6ccc93 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); } } |