no follow callback

git-svn-id: https://develop.svn.wordpress.org/trunk@6105 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-09-13 04:51:33 +00:00
parent d2b1b4ec3b
commit 05d9662d3e
1 changed files with 7 additions and 1 deletions

View File

@ -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('|<a (.+?)>|ie', "'<a ' . str_replace(' rel=\"nofollow\"','',stripslashes('$1')) . ' rel=\"nofollow\">'", $text);
$text = preg_replace_callback('|<a (.+?)>|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 "<a $text rel=\"nofollow\">";
}
function convert_smilies($text) {
global $wp_smiliessearch, $wp_smiliesreplace;
$output = '';