Changeset 6106 for branches/2.2

Show
Ignore:
Timestamp:
09/13/07 04:51:46 (1 year ago)
Author:
ryan
Message:

no follow callback

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/wp-includes/formatting.php

    r5931 r6106  
    637637    // This is a pre save filter, so text is already escaped. 
    638638    $text = stripslashes($text); 
    639     $text = preg_replace('|<a (.+?)>|ie', "'<a ' . str_replace(' rel=\"nofollow\"','',stripslashes('$1')) . ' rel=\"nofollow\">'", $text); 
     639    $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); 
    640640    $text = $wpdb->escape($text); 
    641641    return $text; 
     642} 
     643 
     644function wp_rel_nofollow_callback( $matches ) { 
     645    $text = $matches[1]; 
     646    $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); 
     647    return "<a $text rel=\"nofollow\">"; 
    642648} 
    643649