WordPress.org

Make WordPress Core

Ticket #27498: correctly-identify-post-request-v2.patch

File correctly-identify-post-request-v2.patch, 711 bytes (added by c.axelsson, 5 years ago)
  • wp-includes/canonical.php

    diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php
    index 231855e..9445b0b 100644
    a b  
    3939function redirect_canonical( $requested_url = null, $do_redirect = true ) {
    4040        global $wp_rewrite, $is_IIS, $wp_query, $wpdb;
    4141
    42         if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || !empty($_POST) || is_preview() || is_robots() || ( $is_IIS && !iis7_supports_permalinks() ) )
     42        if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || $_SERVER['REQUEST_METHOD'] !== 'GET' || is_preview() || is_robots() || ( $is_IIS && !iis7_supports_permalinks() ) )
    4343                return;
    4444
    4545        if ( !$requested_url ) {