From 964c0710f002e0480c91db67c93d9ce3c9b80694 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 12 May 2017 22:50:41 +0000 Subject: [PATCH] Revert [40256] for now as some tests are failing in some environments. See #20383. Built from https://develop.svn.wordpress.org/trunk@40661 git-svn-id: http://core.svn.wordpress.org/trunk@40524 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/canonical.php | 24 ++++-------------------- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 2de5486430..11c513d31a 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -391,28 +391,12 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { // trailing /index.php $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']); - $punctuation_pattern = implode( '|', array_map( 'preg_quote', array( - ' ', '%20', // space - '!', '%21', // exclamation mark - '"', '%22', // double quote - "'", '%27', // single quote - '(', '%28', // opening bracket - ')', '%29', // closing bracket - ',', '%2C', // comma - '.', '%2E', // period - ';', '%3B', // semicolon - '{', '%7B', // opening curly bracket - '}', '%7D', // closing curly bracket - '“', '%E2%80%9C', // opening curly quote - '”', '%E2%80%9D', // closing curly quote - ) ) ); - - // Remove trailing spaces and end punctuation from the path. - $redirect['path'] = preg_replace( "#($punctuation_pattern)+$#", '', $redirect['path'] ); + // Remove trailing spaces from the path + $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] ); if ( !empty( $redirect['query'] ) ) { - // Remove trailing spaces and end punctuation from certain terminating query string args. - $redirect['query'] = preg_replace( "#((p|page_id|cat|tag)=[^&]*?)($punctuation_pattern)+$#", '$1', $redirect['query'] ); + // Remove trailing spaces from certain terminating query string args + $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] ); // Clean up empty query strings $redirect['query'] = trim(preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query']), '&'); diff --git a/wp-includes/version.php b/wp-includes/version.php index d12b70f560..e6bcba8556 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40660'; +$wp_version = '4.8-alpha-40661'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.