Make WordPress Core

Ticket #39880: 39880.patch

File 39880.patch, 970 bytes (added by yahil, 8 years ago)
  • canonical.php

     
    441441
    442442        // Ignore differences in host capitalization, as this can lead to infinite redirects
    443443        // Only redirect no-www <=> yes-www
    444         if ( strtolower($original['host']) == strtolower($redirect['host']) ||
     444        if ( isset( $original['host'] ) && isset( $redirect['host'] ) && strtolower($original['host']) == strtolower($redirect['host']) ||
    445445                ( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) )
    446446                $redirect['host'] = $original['host'];
    447447
    448         $compare_original = array( $original['host'], $original['path'] );
     448        if ( isset( $original['host'] ) )
     449                $compare_original = array( $original['host'], $original['path'] );
    449450
    450451        if ( !empty( $original['port'] ) )
    451452                $compare_original[] = $original['port'];