summaryrefslogtreecommitdiffstats
path: root/system/helpers/text_helper.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2009-02-03 15:54:43 +0100
committerDerek Jones <derek.jones@ellislab.com>2009-02-03 15:54:43 +0100
commit1978e12d4221fe7e61749a3206b086e5d4158f77 (patch)
treea59c9ac8cc6bdaace40399b84df8e92d48f3dcf3 /system/helpers/text_helper.php
parent01d6b4f663588e80ca43deafc40090c910eb4b35 (diff)
tweak to ascii_to_entities() for low ascii entities
Diffstat (limited to 'system/helpers/text_helper.php')
-rw-r--r--system/helpers/text_helper.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index fa1de8bc6..ad051cd76 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -127,7 +127,17 @@ if ( ! function_exists('ascii_to_entities'))
if ($ordinal < 128)
{
- $out .= $str[$i];
+ /*
+ If the $temp array has a value but we have moved on, then it seems only
+ fair that we output that entity and restart $temp before continuing. -Paul
+ */
+ if (count($temp) == 1)
+ {
+ $out .= '&#'.array_shift($temp).';';
+ $count = 1;
+ }
+
+ $out .= $str[$i];
}
else
{