no follow callback
git-svn-id: https://develop.svn.wordpress.org/trunk@6105 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d2b1b4ec3b
commit
05d9662d3e
|
@ -647,11 +647,17 @@ function wp_rel_nofollow( $text ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
// This is a pre save filter, so text is already escaped.
|
// This is a pre save filter, so text is already escaped.
|
||||||
$text = stripslashes($text);
|
$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);
|
$text = $wpdb->escape($text);
|
||||||
return $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) {
|
function convert_smilies($text) {
|
||||||
global $wp_smiliessearch, $wp_smiliesreplace;
|
global $wp_smiliessearch, $wp_smiliesreplace;
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
Loading…
Reference in New Issue