Comments: Don't nofollow links within the site.

Fixes #11360.
Built from https://develop.svn.wordpress.org/trunk@36125


git-svn-id: http://core.svn.wordpress.org/trunk@36091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2015-12-30 23:20:25 +00:00
parent 7e516f5cf8
commit 2c9896e8d1
2 changed files with 9 additions and 2 deletions

View File

@ -2336,7 +2336,14 @@ function wp_rel_nofollow( $text ) {
function wp_rel_nofollow_callback( $matches ) {
$text = $matches[1];
$atts = shortcode_parse_atts( $matches[1] );
$rel = 'nofollow';
$rel = 'nofollow';
if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
) {
return "<a $text>";
}
if ( ! empty( $atts['rel'] ) ) {
$parts = array_map( 'trim', explode( ' ', $atts['rel'] ) );
if ( false === array_search( 'nofollow', $parts ) ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36124';
$wp_version = '4.5-alpha-36125';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.