WordPress.org

Make WordPress Core

Ticket #17923: 17923.4.patch

File 17923.4.patch, 1000 bytes (added by kurtpayne, 5 years ago)

Updated for 3.6

  • wp-includes/functions.php

     
    633633 * @param mixed $param1 Either newkey or an associative_array
    634634 * @param mixed $param2 Either newvalue or oldquery or uri
    635635 * @param mixed $param3 Optional. Old query or uri
     636 * @param bool $encode Optional.  If true, values will be rawurlencode()'d
    636637 * @return string New URL query string.
    637638 */
    638639function add_query_arg() {
     
    686687        $qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string
    687688        if ( is_array( $args[0] ) ) {
    688689                $kayvees = $args[0];
     690                if ( true === @$args[3] )
     691                        $kayvees = array_map( 'rawurlencode', $kayvees );
    689692                $qs = array_merge( $qs, $kayvees );
    690693        } else {
    691694                $qs[ $args[0] ] = $args[1];
     695                if ( true === @$args[3] )
     696                        $qs[ $args[0] ] = rawurlencode( $qs[ $args[0] ] );
    692697        }
    693698
    694699        foreach ( $qs as $k => $v ) {