Make WordPress Core

Ticket #2059: formatting.php.patch

File formatting.php.patch, 782 bytes (added by DelGurth, 17 years ago)

Patch (for wordpress HEAD) to fix the removal of slashes in <pre> tags

  • wp-includes/formatting.php

     
    7878        $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee);
    7979        $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
    8080        if (strpos($pee, '<pre') !== false)
    81                 $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') .  stripslashes(clean_pre('$2'))  . '</pre>' ", $pee);
     81                $pee = preg_replace_callback('!(<pre.*?>)(.*?)</pre>!is', create_function('$matches', 'return $matches[1] . clean_pre($matches[2]) . "</pre>";'), $pee);
    8282        $pee = preg_replace( "|\n</p>$|", '</p>', $pee );
    8383
    8484        return $pee;