WordPress.org

Make WordPress Core

Ticket #20143: 20143.diff

File 20143.diff, 1.4 KB (added by nacin, 6 years ago)
  • wp-includes/canonical.php

     
    292292                                unset( $_parsed_query['name'] );
    293293                }
    294294
    295                 $_parsed_query = array_map( 'rawurlencode', $_parsed_query );
     295                $_parsed_query = rawurlencode_deep( $_parsed_query );
    296296                $redirect_url = add_query_arg( $_parsed_query, $redirect_url );
    297297        }
    298298
  • wp-includes/formatting.php

     
    13391339/**
    13401340 * Navigates through an array and encodes the values to be used in a URL.
    13411341 *
    1342  * Uses a callback to pass the value of the array back to the function as a
    1343  * string.
    13441342 *
    13451343 * @since 2.2.0
    13461344 *
     
    13531351}
    13541352
    13551353/**
     1354 * Navigates through an array and raw encodes the values to be used in a URL.
     1355 *
     1356 * @since 3.4.0
     1357 *
     1358 * @param array|string $value The array or string to be encoded.
     1359 * @return array|string $value The encoded array (or string from the callback).
     1360 */
     1361function rawurlencode_deep( $value ) {
     1362        return is_array( $value ) ? array_map( 'rawurlencode_deep', $value ) : rawurlencode( $value );
     1363}
     1364
     1365/**
    13561366 * Converts email addresses characters to HTML entities to block spam bots.
    13571367 *
    13581368 * @since 0.71