Make WordPress Core


Ignore:
Timestamp:
05/12/2017 10:49:48 PM (8 years ago)
Author:
azaozz
Message:

Revert [40256] for now as some tests are failing in some environments.

See #20383.

File:
1 edited

Legend:

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

    r40256 r40661  
    392392    $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']);
    393393
    394     $punctuation_pattern = implode( '|', array_map( 'preg_quote', array(
    395         ' ', '%20',       // space
    396         '!', '%21',       // exclamation mark
    397         '"', '%22',       // double quote
    398         "'", '%27',       // single quote
    399         '(', '%28',       // opening bracket
    400         ')', '%29',       // closing bracket
    401         ',', '%2C',       // comma
    402         '.', '%2E',       // period
    403         ';', '%3B',       // semicolon
    404         '{', '%7B',       // opening curly bracket
    405         '}', '%7D',       // closing curly bracket
    406         '“', '%E2%80%9C', // opening curly quote
    407         '”', '%E2%80%9D', // closing curly quote
    408     ) ) );
    409 
    410     // Remove trailing spaces and end punctuation from the path.
    411     $redirect['path'] = preg_replace( "#($punctuation_pattern)+$#", '', $redirect['path'] );
     394    // Remove trailing spaces from the path
     395    $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] );
    412396
    413397    if ( !empty( $redirect['query'] ) ) {
    414         // Remove trailing spaces and end punctuation from certain terminating query string args.
    415         $redirect['query'] = preg_replace( "#((p|page_id|cat|tag)=[^&]*?)($punctuation_pattern)+$#", '$1', $redirect['query'] );
     398        // Remove trailing spaces from certain terminating query string args
     399        $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] );
    416400
    417401        // Clean up empty query strings
Note: See TracChangeset for help on using the changeset viewer.