Changeset 6105

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

no follow callback

Files:

Legend:

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

    r6102 r6105  
    648648    // This is a pre save filter, so text is already escaped. 
    649649    $text = stripslashes($text); 
    650     $text = preg_replace('|<a (.+?)>|ie', "'<a ' . str_replace(' rel=\"nofollow\"','',stripslashes('$1')) . ' rel=\"nofollow\">'", $text); 
     650    $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); 
    651651    $text = $wpdb->escape($text); 
    652652    return $text; 
     653} 
     654 
     655function wp_rel_nofollow_callback( $matches ) { 
     656    $text = $matches[1]; 
     657    $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); 
     658    return "<a $text rel=\"nofollow\">"; 
    653659} 
    654660