Don't duplicate nofollow on edit. Props filosofo. fixes #2995

git-svn-id: http://svn.automattic.com/wordpress/trunk@4135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-08-30 16:50:12 +00:00
parent cdc1c73f61
commit bbb5ffca6d

View File

@ -598,7 +598,7 @@ function wp_rel_nofollow( $text ) {
global $wpdb;
// This is a pre save filter, so text is already escaped.
$text = stripslashes($text);
$text = preg_replace('|<a (.+?)>|i', '<a $1 rel="nofollow">', $text);
$text = preg_replace('|<a (.+?)>|ie', "'<a ' . str_replace(' rel=\"nofollow\"','',stripslashes('$1')) . ' rel=\"nofollow\">'", $text);
$text = $wpdb->escape($text);
return $text;
}