no follow callback

git-svn-id: http://svn.automattic.com/wordpress/trunk@6105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-09-13 04:51:33 +00:00
parent 95908afb48
commit 103e793478
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 = '';