diff options
-rw-r--r-- | system/libraries/Typography.php | 18 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 10 insertions, 9 deletions
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 5a97da715..9490c7ce5 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -86,22 +86,22 @@ class CI_Typography { // within tags so we'll temporarily convert them to {@DQ} and {@SQ} if (preg_match_all("#\<.+?>#si", $str, $matches)) { - for ($i = 0; $i < count($matches['0']); $i++) + 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 = str_replace($matches[0][$i], + str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches[0][$i]), $str); } } - + if ($this->protect_braced_quotes === TRUE) { if (preg_match_all("#\{.+?}#si", $str, $matches)) { - for ($i = 0; $i < count($matches['0']); $i++) + 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 = str_replace($matches[0][$i], + str_replace(array("'",'"'), array('{@SQ}', '{@DQ}'), $matches[0][$i]), $str); } } @@ -160,13 +160,13 @@ class CI_Typography { // Convert quotes, elipsis, and em-dashes $str = $this->format_characters($str); - + // Final clean up $table = array( // If the user submitted their own paragraph tags within the text // we will retain them instead of using our tags. - '/(<p.*?>)<p>/' => '$1', // <?php BBEdit syntax coloring bug fix + '/(<p[^>*?]>)<p>/' => '$1', // <?php BBEdit syntax coloring bug fix // Reduce multiple instances of opening/closing paragraph tags to a single one '#(</p>)+#' => '</p>', diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7114702b4..5fab65f56 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@ SVN Revision: </p> <li>Fixed a bug in the MySQLi driver when no port is specified</li>
<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>
</ul>
|