summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-09 13:20:57 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-09 13:20:57 +0100
commit40235e6890650690afeaa451738bf7f8e586cfc3 (patch)
tree945d994692989e1f83e1c2b2edeb84bbe019ec7f
parentd1755f81ac0f081e3acccbb54e2ab8ff46471ff4 (diff)
Fix #133
-rw-r--r--system/helpers/text_helper.php7
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 7 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).';';
+ }
}
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index c186781d1..40855bc68 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -662,6 +662,7 @@ Bug fixes for 3.0
- Fixed a bug (#148) - while sanitizing input data, ``CI_Input::_clean_input_data()`` assumed that it is URL-encoded, stripping certain character sequences from it.
- Fixed a bug (#346) - with ``$config['global_xss_filtering']`` turned on, the ``$_GET``, ``$_POST``, ``$_COOKIE`` and ``$_SERVER`` superglobals were overwritten during initialization time, resulting in XSS filtering being either performed twice or there was no possible way to get the original data, even though options for this do exist.
- Fixed an edge case (#555) - incorrect browser version was reported for Opera 10+ due to a non-standard user-agent string.
+- Fixed a bug (#133) - :doc:`Text Helper <helpers/text_helper>` :func:`ascii_to_entities()` stripped the last character if it happens to be in the extended ASCII group.
Version 2.1.4
=============