WordPress.org

Make WordPress Core

Ticket #2995: formatting.php.diff

File formatting.php.diff, 582 bytes (added by filosofo, 9 years ago)
  • wp-includes/formatting.php

     
    598598        global $wpdb; 
    599599        // This is a pre save filter, so text is already escaped. 
    600600        $text = stripslashes($text); 
    601         $text = preg_replace('|<a (.+?)>|i', '<a $1 rel="nofollow">', $text); 
     601        $text = preg_replace('|<a (.+?)>|ie', "'<a ' . str_replace(' rel=\"nofollow\"','',stripslashes('$1')) . ' rel=\"nofollow\">'", $text); 
    602602        $text = $wpdb->escape($text); 
    603603        return $text; 
    604604}