Ticket #21332: 21332.patch
File 21332.patch, 1.3 KB (added by , 11 years ago) |
---|
-
wp-includes/functions.php
637 637 */ 638 638 function add_query_arg() { 639 639 $ret = ''; 640 if ( is_array( func_get_arg(0) ) ) { 641 if ( func_num_args() < 2 || false === func_get_arg( 1 ) ) 640 $args = func_get_args(); 641 if ( is_array( $args[0] ) ) { 642 if ( count( $args ) < 2 || false === $args[1] ) 642 643 $uri = $_SERVER['REQUEST_URI']; 643 644 else 644 $uri = func_get_arg( 1 );645 $uri = $args[1]; 645 646 } else { 646 if ( func_num_args() < 3 || false === func_get_arg( 2 ))647 if ( count( $args ) < 3 || false === $args[2] ) 647 648 $uri = $_SERVER['REQUEST_URI']; 648 649 else 649 $uri = func_get_arg( 2 );650 $uri = $args[2]; 650 651 } 651 652 652 653 if ( $frag = strstr( $uri, '#' ) ) … … 680 681 681 682 wp_parse_str( $query, $qs ); 682 683 $qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string 683 if ( is_array( func_get_arg( 0 )) ) {684 $kayvees = func_get_arg( 0 );684 if ( is_array( $args[0] ) ) { 685 $kayvees = $args[0]; 685 686 $qs = array_merge( $qs, $kayvees ); 686 687 } else { 687 $qs[ func_get_arg( 0 )] = func_get_arg( 1 );688 $qs[ $args[0] ] = $args[1]; 688 689 } 689 690 690 691 foreach ( (array) $qs as $k => $v ) {