WordPress.org

Make WordPress Core

Changeset 20611


Ignore:
Timestamp:
04/27/2012 03:40:00 PM (6 years ago)
Author:
nacin
Message:

Run rawurlencode_deep() through the parsed query in canonical. (Introduces rawurlencode_deep().) props toppa for the initial patch. fixes #20143.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/canonical.php

    r20596 r20611  
    302302        }
    303303
    304         $_parsed_query = array_map( 'rawurlencode', $_parsed_query );
     304        $_parsed_query = rawurlencode_deep( $_parsed_query );
    305305        $redirect_url = add_query_arg( $_parsed_query, $redirect_url );
    306306    }
  • trunk/wp-includes/formatting.php

    r20466 r20611  
    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
     
    13511349    $value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value);
    13521350    return $value;
     1351}
     1352
     1353/**
     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 );
    13531363}
    13541364
Note: See TracChangeset for help on using the changeset viewer.