Ticket #39048: wp_parse_str_undifeied_vars.2.patch
File wp_parse_str_undifeied_vars.2.patch, 2.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/functions.php
807 807 $base = ''; 808 808 $query = $uri; 809 809 } 810 810 $qs = array(); 811 811 wp_parse_str( $query, $qs ); 812 812 $qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string 813 813 if ( is_array( $args[0] ) ) { … … 3434 3433 elseif ( is_array( $args ) ) 3435 3434 $r =& $args; 3436 3435 else 3436 $r = array(); 3437 3437 wp_parse_str( $args, $r ); 3438 3438 3439 3439 if ( is_array( $defaults ) ) -
src/wp-includes/general-template.php
3277 3277 // Find the format argument. 3278 3278 $format = explode( '?', str_replace( '%_%', $args['format'], $args['base'] ) ); 3279 3279 $format_query = isset( $format[1] ) ? $format[1] : ''; 3280 $format_args = array(); 3280 3281 wp_parse_str( $format_query, $format_args ); 3281 3282 3282 3283 // Find the query args of the requested URL. 3284 $url_query_args = array(); 3283 3285 wp_parse_str( $url_parts[1], $url_query_args ); 3284 3286 3285 3287 // Remove the format argument from the array of query arguments, to avoid overwriting custom format. -
src/wp-includes/script-loader.php
1030 1030 1031 1031 $parsed = parse_url( $src ); 1032 1032 if ( isset($parsed['query']) && $parsed['query'] ) { 1033 $qv = array(); 1033 1034 wp_parse_str( $parsed['query'], $qv ); 1034 1035 $url = add_query_arg( $qv, $url ); 1035 1036 } -
tests/phpunit/tests/functions.php
35 35 36 36 function test_wp_parse_args_other() { 37 37 $b = true; 38 $s = array(); 38 39 wp_parse_str($b, $s); 39 40 $this->assertEquals($s, wp_parse_args($b)); 40 41 $q = 'x=5&_baba=dudu&'; 42 $ss = array(); 41 43 wp_parse_str($q, $ss); 42 44 $this->assertEquals($ss, wp_parse_args($q)); 43 45 }