Formatting: Fix a PHP warning in introduced in [44840].
Merges [44864] to the 4.5 branch. Built from https://develop.svn.wordpress.org/branches/4.5@44865 git-svn-id: http://core.svn.wordpress.org/branches/4.5@44696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fb7f4bf7b6
commit
f056a36272
|
@ -2351,8 +2351,13 @@ function wp_rel_nofollow_callback( $matches ) {
|
||||||
$rel = 'nofollow';
|
$rel = 'nofollow';
|
||||||
|
|
||||||
if ( ! empty( $atts['href'] ) ) {
|
if ( ! empty( $atts['href'] ) ) {
|
||||||
if ( in_array( strtolower( wp_parse_url( $atts['href'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) {
|
$href_parts = wp_parse_url( $atts['href'] );
|
||||||
if ( strtolower( wp_parse_url( $atts['href'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) {
|
$href_scheme = isset( $href_parts['scheme'] ) ? $href_parts['scheme'] : '';
|
||||||
|
$href_host = isset( $href_parts['host'] ) ? $href_parts['host'] : '';
|
||||||
|
$home_parts = wp_parse_url( home_url() );
|
||||||
|
$home_host = isset( $home_parts['host'] ) ? $home_parts['host'] : '';
|
||||||
|
if ( in_array( strtolower( $href_scheme ), array( 'http', 'https' ), true ) ) {
|
||||||
|
if ( strtolower( $href_host ) === strtolower( $home_host ) ) {
|
||||||
return "<a $text>";
|
return "<a $text>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue