WordPress.org

Make WordPress Core

Changeset 44864


Ignore:
Timestamp:
03/13/2019 12:34:42 AM (2 months ago)
Author:
SergeyBiryukov
Message:

Formatting: Fix a PHP warning in introduced in [44839].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.6/src/wp-includes/formatting.php

    r44839 r44864  
    27182718
    27192719    if ( ! empty( $atts['href'] ) ) {
    2720         if ( in_array( strtolower( wp_parse_url( $atts['href'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) {
    2721             if ( strtolower( wp_parse_url( $atts['href'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) {
     2720        $href_parts  = wp_parse_url( $atts['href'] );
     2721        $href_scheme = isset( $href_parts['scheme'] ) ? $href_parts['scheme'] : '';
     2722        $href_host   = isset( $href_parts['host'] ) ? $href_parts['host'] : '';
     2723        $home_parts  = wp_parse_url( home_url() );
     2724        $home_host   = isset( $home_parts['host'] ) ? $home_parts['host'] : '';
     2725        if ( in_array( strtolower( $href_scheme ), array( 'http', 'https' ), true ) ) {
     2726            if ( strtolower( $href_host ) === strtolower( $home_host ) ) {
    27222727                return "<a $text>";
    27232728            }
Note: See TracChangeset for help on using the changeset viewer.