From 1978e12d4221fe7e61749a3206b086e5d4158f77 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 3 Feb 2009 14:54:43 +0000 Subject: tweak to ascii_to_entities() for low ascii entities --- system/helpers/text_helper.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'system') 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 { -- cgit v1.2.3-24-g4f1b