From 40262adc37b2e0963686e5a5151eff6ad52ec56f Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 13 Sep 2007 04:51:46 +0000 Subject: [PATCH] no follow callback git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@6106 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 cb8b372e97..b20c2d3a49 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -636,11 +636,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 = '';