WordPress.org

Make WordPress Core

Ticket #20143: canonical.diff

File canonical.diff, 623 bytes (added by toppa, 6 years ago)
  • canonical.php

     
    280280                                unset( $_parsed_query['name'] );
    281281                }
    282282
    283                 $_parsed_query = array_map( 'rawurlencode', $_parsed_query );
     283                array_walk_recursive( $_parsed_query, 'rawurlencode_callback' );
    284284                $redirect_url = add_query_arg( $_parsed_query, $redirect_url );
    285285        }
    286286
     
    495495}
    496496
    497497add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
     498
     499function rawurlencode_callback(&$string, $key = null) {
     500        $string = rawurlencode($string);
     501}