Ticket #20383: 20383.2.patch
File 20383.2.patch, 1.4 KB (added by , 8 years ago) |
---|
-
src/wp-includes/canonical.php
391 391 // trailing /index.php 392 392 $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']); 393 393 394 // Remove trailing spaces from the path395 $redirect['path'] = preg_replace( '#( %20| )+$#', '', $redirect['path'] );394 // Remove trailing spaces and end punctuation from the path. 395 $redirect['path'] = preg_replace( '#([^0-9a-zA-Z/]|%22|%7B|\)|%27|%E2%80%9C|%E2%80%9D|%20| )+$#', '', $redirect['path'] ); 396 396 397 397 if ( !empty( $redirect['query'] ) ) { 398 398 // Remove trailing spaces from certain terminating query string args -
tests/phpunit/tests/canonical/noRewrite.php
55 55 array( '/?feed=rss2&p=1', '/?feed=rss2&p=1', 21841 ), 56 56 array( '/?feed=rss&p=1', '/?feed=rss2&p=1', 24623 ), 57 57 58 // Trailing spaces and punctuation. 59 array( '/page/2/ ', '/page/2/' ), 60 array( '/page/2/%22', '/page/2/' ), 61 array( '/page/2/%27', '/page/2/' ), 62 array( '/page/2/%E2%80%9C', '/page/2/' ), 58 63 ); 59 64 } 60 65 }