mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01:00
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:
parent
7e516f5cf8
commit
2c9896e8d1
@ -2337,6 +2337,13 @@ function wp_rel_nofollow_callback( $matches ) {
|
|||||||
$text = $matches[1];
|
$text = $matches[1];
|
||||||
$atts = shortcode_parse_atts( $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'] ) ) {
|
if ( ! empty( $atts['rel'] ) ) {
|
||||||
$parts = array_map( 'trim', explode( ' ', $atts['rel'] ) );
|
$parts = array_map( 'trim', explode( ' ', $atts['rel'] ) );
|
||||||
if ( false === array_search( 'nofollow', $parts ) ) {
|
if ( false === array_search( 'nofollow', $parts ) ) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user