Make WordPress Core

Ticket #31499: 31499.diff

File 31499.diff, 727 bytes (added by pento, 10 years ago)
  • src/wp-includes/canonical.php

     
    8383        if ( !isset($redirect['query']) )
    8484                $redirect['query'] = '';
    8585
     86        // If the original URL ended with non-breaking spaces, they were almost
     87        // certainly inserted by accident. Let's remove them, so the reader doesn't
     88        // see a 404 method with no obvious cause.
     89        $redirect['path'] = preg_replace( '|(%C2%A0)+$|i', '', $redirect['path'] );
     90
    8691        // It's not a preview, so remove it from URL
    8792        if ( get_query_var( 'preview' ) ) {
    8893                $redirect['query'] = remove_query_arg( 'preview', $redirect['query'] );