diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-10-29 23:09:27 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-10-29 23:09:27 +0100 |
commit | 0d37ed81f73c7905053643081d45394d956c4bfa (patch) | |
tree | 394fcc9983a55b3170a35ab97b542e3ce6a63c05 | |
parent | 98a4a3d84695ec459c2aec5e57323cc6f8a48e71 (diff) |
added protection for dashes so they aren't converted into emdashes in tags
-rw-r--r-- | system/libraries/Typography.php | 8 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 9490c7ce5..317208f2f 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -84,12 +84,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} 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}'), $matches[0][$i]), + str_replace(array("'",'"','--'), array('{@SQ}', '{@DQ}', '{@DD}'), $matches[0][$i]), $str); } } @@ -106,7 +107,7 @@ class CI_Typography { } } } - + // Convert "ignore" tags to temporary marker. The parser splits out the string at every tag // it encounters. Certain inline tags, like image tags, links, span tags, etc. will be // adversely affected if they are split out so we'll convert the opening bracket < temporarily to: {@TAG} @@ -178,7 +179,8 @@ class CI_Typography { // Replace the temporary markers we added earlier '/\{@TAG\}/' => '<', '/\{@DQ\}/' => '"', - '/\{@SQ\}/' => "'" + '/\{@SQ\}/' => "'", + '/\{@DD\}/' => '--' ); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e14c8f184..b1d7d9f64 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,6 +75,7 @@ SVN Revision: </p> <li>Fixed a bug (#5702), in which the field label was not being fetched properly, when "matching" one field to another.</li>
<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>
</ul>
|