Changeset 41991 for trunk/src/wp-includes/canonical.php
- Timestamp:
- 10/24/2017 02:17:22 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/canonical.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r41257 r41991 393 393 $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']); 394 394 395 // Remove trailing spaces from the path 396 $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] ); 395 $punctuation_pattern = implode( '|', array_map( 'preg_quote', array( 396 ' ', '%20', // space 397 '!', '%21', // exclamation mark 398 '"', '%22', // double quote 399 "'", '%27', // single quote 400 '(', '%28', // opening bracket 401 ')', '%29', // closing bracket 402 ',', '%2C', // comma 403 '.', '%2E', // period 404 ';', '%3B', // semicolon 405 '{', '%7B', // opening curly bracket 406 '}', '%7D', // closing curly bracket 407 '%E2%80%9C', // opening curly quote 408 '%E2%80%9D', // closing curly quote 409 ) ) ); 410 411 // Remove trailing spaces and end punctuation from the path. 412 $redirect['path'] = preg_replace( "#($punctuation_pattern)+$#", '', $redirect['path'] ); 397 413 398 414 if ( !empty( $redirect['query'] ) ) { 399 // Remove trailing spaces from certain terminating query string args400 $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] );415 // Remove trailing spaces and end punctuation from certain terminating query string args. 416 $redirect['query'] = preg_replace( "#((p|page_id|cat|tag)=[^&]*?)($punctuation_pattern)+$#", '$1', $redirect['query'] ); 401 417 402 418 // Clean up empty query strings
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)