Ticket #2650: balanceTags.diff

File balanceTags.diff, 919 bytes (added by markjaquith, 7 years ago)

balanceTags() fix

Line 
1Index: wp-includes/functions-formatting.php
2===================================================================
3--- wp-includes/functions-formatting.php        (revision 3700)
4+++ wp-includes/functions-formatting.php        (working copy)
5@@ -383,8 +383,14 @@
6        return $text;
7 }
8 
9+function balanceTags($text, $is_comment = 0) {
10+       if ( get_options('use_balanceTags') == 0 )
11+               return $text;
12+       return wpbalancetags($text, $is_comment);
13+}
14+
15 /*
16- balanceTags
17+ wpbalancetags
18 
19  Balances Tags of string using a modified stack.
20 
21@@ -402,11 +408,8 @@
22                   Added Cleaning Hooks
23              1.0  First Version
24 */
25-function balanceTags($text, $is_comment = 0) {
26+function wpbalancetags($text, $is_comment = 0) {
27 
28-       if ( get_option('use_balanceTags') == 0)
29-               return $text;
30-
31        $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
32 
33        # WP bug fix for comments - in case you REALLY meant to type '< !--'