WordPress.org

Make WordPress Core

Changeset 9645


Ignore:
Timestamp:
11/12/08 21:08:48 (7 years ago)
Author:
markjaquith
Message:

Catch more blank query string thing cases, without resorting to crazy regex. props filosofo. fixes #8098

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/canonical.php

    r9642 r9645  
    205205 
    206206        // Clean up empty query strings 
    207         $redirect['query'] = preg_replace( '#(^\??|&)(p|page_id|cat|tag)=?$#', '', $redirect['query'] ); 
     207        $redirect['query'] = trim(preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query']), '&'); 
    208208 
    209209        // Remove redundant leading ampersands 
Note: See TracChangeset for help on using the changeset viewer.