WordPress.org

Make WordPress Core

Ticket #2059: wpautop_no_removal_of_slashes_in_pre.patch

File wpautop_no_removal_of_slashes_in_pre.patch, 1.1 KB (added by allan, 8 years ago)

Patch to fix the problem

  • wp-includes/functions-formatting.php

     
    5151        $text = str_replace('<br />', '', $text); 
    5252        $text = str_replace('<p>', "\n", $text); 
    5353        $text = str_replace('</p>', '', $text); 
     54        $text = str_replace('\"', '"', $text); 
    5455        return $text; 
    5556} 
    5657 
     
    7374        if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 
    7475        $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee); 
    7576        $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee); 
    76         $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') .  stripslashes(clean_pre('$2'))  . '</pre>' ", $pee); 
     77        $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') .  clean_pre('$2')  . '</pre>' ", $pee); 
    7778         
    7879        return $pee;  
    7980}