WordPress.org

Make WordPress Core

Ticket #20143: 20143.patch

File 20143.patch, 845 bytes (added by SergeyBiryukov, 6 years ago)
  • wp-includes/canonical.php

     
    292292                                unset( $_parsed_query['name'] );
    293293                }
    294294
    295                 $_parsed_query = array_map( 'rawurlencode', $_parsed_query );
     295                array_walk_recursive( $_parsed_query, '_rawurlencode_callback' );
    296296                $redirect_url = add_query_arg( $_parsed_query, $redirect_url );
    297297        }
    298298
     
    448448}
    449449
    450450/**
     451 * Private array_walk_recursive callback used in redirect_canonical()
     452 *
     453 * @since 3.4
     454 * @access private
     455 */
     456function _rawurlencode_callback( &$string, $key = null ) {
     457        $string = rawurlencode( $string );
     458}
     459
     460/**
    451461 * Attempts to guess the correct URL from the current URL (that produced a 404) or
    452462 * the current query variables.
    453463 *