Skip to content

Commit

Permalink
TRAC 53635 | PHP 8.1: wp_parse_str() - fix handling of null
Browse files Browse the repository at this point in the history
Fixes `parse_str(): Passing null to parameter #1 ($string) of type string is deprecated` notices on PHP 8.1.

Impact: 311 of the pre-existing tests are affected by this issue.
  • Loading branch information
jrfnl committed Aug 13, 2021
1 parent 5d263a2 commit 1397575
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4964,7 +4964,7 @@ function map_deep( $value, $callback ) {
* @param array $array Variables will be stored in this array.
*/
function wp_parse_str( $string, &$array ) {
parse_str( $string, $array );
parse_str( (string) $string, $array );
/**
* Filters the array of variables derived from a parsed string.
Expand Down

0 comments on commit 1397575

Please sign in to comment.