WordPress.org

Make WordPress Core

Changeset 44865


Ignore:
Timestamp:
03/13/2019 12:37:02 AM (11 days ago)
Author:
SergeyBiryukov
Message:

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

Merges [44864] to the 4.5 branch.

Location:
branches/4.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/4.5/src/wp-includes/formatting.php

    r44840 r44865  
    23522352
    23532353    if ( ! empty( $atts['href'] ) ) {
    2354         if ( in_array( strtolower( wp_parse_url( $atts['href'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) {
    2355             if ( strtolower( wp_parse_url( $atts['href'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) {
     2354        $href_parts  = wp_parse_url( $atts['href'] );
     2355        $href_scheme = isset( $href_parts['scheme'] ) ? $href_parts['scheme'] : '';
     2356        $href_host   = isset( $href_parts['host'] ) ? $href_parts['host'] : '';
     2357        $home_parts  = wp_parse_url( home_url() );
     2358        $home_host   = isset( $home_parts['host'] ) ? $home_parts['host'] : '';
     2359        if ( in_array( strtolower( $href_scheme ), array( 'http', 'https' ), true ) ) {
     2360            if ( strtolower( $href_host ) === strtolower( $home_host ) ) {
    23562361                return "<a $text>";
    23572362            }
Note: See TracChangeset for help on using the changeset viewer.