Ticket #39048: wp_parse_str_undifeied_vars.patch
| File wp_parse_str_undifeied_vars.patch, 2.7 KB (added by , 10 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] ) ) { … … 1195 1195 * @return bool True if yes, false on anything else. 1196 1196 */ 1197 1197 function bool_from_yn( $yn ) { 1198 return ( strtolower( $yn ) == 'y');1198 return ( 'y' === strtolower( $yn ) ); 1199 1199 } 1200 1200 1201 1201 /** … … 1202 1202 * Load the feed template from the use of an action hook. 1203 1203 * 1204 1204 * If the feed action does not have a hook, then the function will die with a 1205 * message telling the visitor that the feed is not valid.1206 1205 * 1207 1206 * It is better to only have one hook for each feed. 1208 1207 * … … 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 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)