WordPress.org

Make WordPress Core

Changeset 9645


Ignore:
Timestamp:
11/12/2008 09:08:48 PM (10 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.