Make WordPress Core


Ignore:
Timestamp:
08/25/2008 09:50:11 PM (16 years ago)
Author:
ryan
Message:

Notice fixes. see #7509

File:
1 edited

Legend:

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

    r8667 r8732  
    157157    $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] );
    158158
    159     // Remove trailing slashes from certain terminating query string args
    160     $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] );
    161 
    162     // Clean up empty query strings
    163     $redirect['query'] = preg_replace( '#&?(p|page_id|cat|tag)=?$#', '', $redirect['query'] );
     159    if ( isset( $redirect['query'] ) ) {
     160        // Remove trailing slashes from certain terminating query string args
     161        $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] );
     162
     163        // Clean up empty query strings
     164        $redirect['query'] = preg_replace( '#&?(p|page_id|cat|tag)=?$#', '', $redirect['query'] );
     165    }
    164166
    165167    // strip /index.php/ when we're not using PATHINFO permalinks
Note: See TracChangeset for help on using the changeset viewer.