WordPress.org

Make WordPress Core

Ticket #48025: 48025.patch

File 48025.patch, 854 bytes (added by Toro_Unit, 2 months ago)
  • src/wp-includes/canonical.php

     
    5656                }
    5757        }
    5858
    59         if ( is_trackback() || is_search() || is_admin() || is_preview() || is_robots() || ( $is_IIS && ! iis7_supports_permalinks() ) ) {
     59        if ( is_trackback() || is_search() || is_admin() || is_preview() || ( $is_IIS && ! iis7_supports_permalinks() ) ) {
    6060                return;
    6161        }
    6262
     
    530530                $redirect['host'] = $original['host'];
    531531        }
    532532
     533        //Even if the permalink structure ends with a slash, remove slash robots.txt.
     534        if ( is_robots() ) {
     535                $redirect['path'] = untrailingslashit( $redirect['path'] );
     536        }
     537
    533538        $compare_original = array( $original['host'], $original['path'] );
    534539
    535540        if ( ! empty( $original['port'] ) ) {