WordPress.org

Make WordPress Core

Ticket #20374: 20374.diff

File 20374.diff, 630 bytes (added by markjaquith, 3 years ago)

strip some common parameters that we do not need if we have an actual URL.

  • wp-includes/canonical.php

     
    9292                        } 
    9393                } 
    9494 
    95                 if ( ! $redirect_url ) 
     95                if ( ! $redirect_url ) { 
    9696                        $redirect_url = redirect_guess_404_permalink( $requested_url ); 
     97                        $redirect['query'] = remove_query_arg( array( 'p', 'page_id', 'attachment_id', 'post_type', 'pagename', 'name' ), $redirect['query'] ); 
     98                } 
    9799 
    98100        } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) { 
    99101                // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101