diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-11-04 20:20:36 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-11-04 20:20:36 +0100 |
commit | cc13d49e83757cf540082eaddf0483153c027c83 (patch) | |
tree | e392c151e13a92951330f4d03e92c4e8c6ff2c98 | |
parent | 1bf63e459baf22ab9fc3bade9697577a09054b80 (diff) |
added protection against non-breaking spaces within tags
-rw-r--r-- | system/libraries/Typography.php | 6 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 317208f2f..8ae47a1b1 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -85,12 +85,13 @@ class CI_Typography { // Convert quotes within tags to temporary markers. We don't want quotes converted // within tags so we'll temporarily convert them to {@DQ} and {@SQ} // and we don't want double dashes converted to emdash entities, so they are marked with {@DD} + // likewise double spaces are converted to {@NBS} to prevent entity conversion if (preg_match_all("#\<.+?>#si", $str, $matches)) { for ($i = 0, $total = count($matches[0]); $i < $total; $i++) { $str = str_replace($matches[0][$i], - str_replace(array("'",'"','--'), array('{@SQ}', '{@DQ}', '{@DD}'), $matches[0][$i]), + str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $matches[0][$i]), $str); } } @@ -180,7 +181,8 @@ class CI_Typography { '/\{@TAG\}/' => '<', '/\{@DQ\}/' => '"', '/\{@SQ\}/' => "'", - '/\{@DD\}/' => '--' + '/\{@DD\}/' => '--', + '/\{@NBS\}/' => ' ' ); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 55bcbf03d..8fafcc76e 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -82,6 +82,7 @@ SVN Revision: </p> <li>Fixed a bug in which identifers were not being escaped properly when reserved characters were used.</li> <li>Fixed a bug with the regular expression used to protect submitted paragraph tags in auto typography.</p> <li>Fixed a bug where double dashes within tag attributes were being converted to em dash entities.</li> + <li>Fixed a bug where double spaces within tag attributes were being converted to non-breaking space entities.</li> </ul> |