summaryrefslogtreecommitdiffstats
path: root/system/helpers/text_helper.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-02-16 20:03:49 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-02-16 20:03:49 +0100
commit33ed0f37b6b8f2223cd3362bf8fca28102ab67c6 (patch)
tree99c613720a2fd8541764bb6fc893e0da28fa269b /system/helpers/text_helper.php
parent154da11c5bb4b7dc5c225f4fa018852ee45cc6eb (diff)
parentd8d1e24eee56d2466c91ecd72b3c8932eb3d0639 (diff)
Merged CodeIgniter Core changes and integrated rob1's secure cookie change into my secure cookie change.
Diffstat (limited to 'system/helpers/text_helper.php')
-rw-r--r--system/helpers/text_helper.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index e1b56c9c9..96afd4cee 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);
}
}
@@ -452,7 +443,7 @@ if ( ! function_exists('word_wrap'))
}
$temp = '';
- while((strlen($line)) > $charlim)
+ while ((strlen($line)) > $charlim)
{
// If the over-length word is a URL we won't wrap it
if (preg_match("!\[url.+\]|://|wwww.!", $line))