diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-09 13:20:57 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-09 13:20:57 +0100 |
commit | 40235e6890650690afeaa451738bf7f8e586cfc3 (patch) | |
tree | 945d994692989e1f83e1c2b2edeb84bbe019ec7f /system/helpers | |
parent | d1755f81ac0f081e3acccbb54e2ab8ff46471ff4 (diff) |
Fix #133
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/text_helper.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index c6d14784b..bda844630 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -127,7 +127,7 @@ if ( ! function_exists('ascii_to_entities')) function ascii_to_entities($str) { $out = ''; - for ($i = 0, $s = strlen($str), $count = 1, $temp = array(); $i < $s; $i++) + for ($i = 0, $s = strlen($str) - 1, $count = 1, $temp = array(); $i <= $s; $i++) { $ordinal = ord($str[$i]); @@ -164,6 +164,11 @@ if ( ! function_exists('ascii_to_entities')) $count = 1; $temp = array(); } + // If this is the last iteration, just output whatever we have + elseif ($i === $s) + { + $out .= '&#'.implode(';', $temp).';'; + } } } |