WordPress.org

Make WordPress Core

Ticket #5272: 5272.patch

File 5272.patch, 1.1 KB (added by pishmishy, 6 years ago)

Basic fix for this issue

  • wp-includes/canonical.php

     
    44function redirect_canonical($requested_url=NULL, $do_redirect=true) { 
    55        global $wp_rewrite, $posts, $is_IIS; 
    66 
    7         if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) || is_preview() ) 
     7        if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) || is_preview()|| is_empty() ) 
    88                return; 
    99 
    1010        if ( !$requested_url ) { 
     
    198198 
    199199add_action('template_redirect', 'redirect_canonical'); 
    200200 
    201 ?> 
    202  No newline at end of file 
     201?> 
  • wp-includes/query.php

     
    216216        return false; 
    217217} 
    218218 
     219function is_empty () { 
     220        global $wp_query; 
     221        return empty($post); 
     222} 
     223 
    219224function is_singular() { 
    220225        global $wp_query; 
    221226