WordPress.org

Make WordPress Core

Ticket #17923: 17923.5.patch

File 17923.5.patch, 1000 bytes (added by kurtpayne, 15 months ago)

Use 'empty' instead of a silence operator

  • 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 ( !empty( $args[3] ) ) 
     691                        $kayvees = array_map( 'rawurlencode', $kayvees ); 
    689692                $qs = array_merge( $qs, $kayvees ); 
    690693        } else { 
    691694                $qs[ $args[0] ] = $args[1]; 
     695                if ( !empty( $args[3] ) ) 
     696                        $qs[ $args[0] ] = rawurlencode( $qs[ $args[0] ] ); 
    692697        } 
    693698 
    694699        foreach ( $qs as $k => $v ) {