From 05d9662d3e79a3f28f1790215459e7f6cd00d662 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 13 Sep 2007 04:51:33 +0000 Subject: [PATCH] no follow callback git-svn-id: https://develop.svn.wordpress.org/trunk@6105 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 5e19a02475..bcb8dfa049 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -647,11 +647,17 @@ function wp_rel_nofollow( $text ) { global $wpdb; // This is a pre save filter, so text is already escaped. $text = stripslashes($text); - $text = preg_replace('||ie', "''", $text); + $text = preg_replace_callback('||i', 'wp_rel_nofollow_callback', $text); $text = $wpdb->escape($text); return $text; } +function wp_rel_nofollow_callback( $matches ) { + $text = $matches[1]; + $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); + return ""; +} + function convert_smilies($text) { global $wp_smiliessearch, $wp_smiliesreplace; $output = '';