summaryrefslogtreecommitdiffstats
path: root/system/helpers/text_helper.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-01-27 12:56:45 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-01-27 12:56:45 +0100
commit3bb336cf1c55584bb92ed32563a9543ec7f01574 (patch)
tree76c2d963be0b7c70705369ca4a9f82946df8bba8 /system/helpers/text_helper.php
parent7d3a1894be6b1722c668d73ce53533bb72cc237c (diff)
parent705a3eec44635f3fada8daa2886d409e6447ca12 (diff)
Automated merge with https://bitbucket.org/ellislab/codeigniter
Diffstat (limited to 'system/helpers/text_helper.php')
-rw-r--r--system/helpers/text_helper.php17
1 files changed, 4 insertions, 13 deletions
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);
}
}