Changeset 40661 for trunk/src/wp-includes/canonical.php
- Timestamp:
- 05/12/2017 10:49:48 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r40256 r40661 392 392 $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']); 393 393 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'] ); 412 396 413 397 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'] ); 416 400 417 401 // Clean up empty query strings
Note: See TracChangeset
for help on using the changeset viewer.