Skip to content

Commit 1397575

Browse files
committed
TRAC 53635 | PHP 8.1: wp_parse_str() - fix handling of null
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.
1 parent 5d263a2 commit 1397575

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/formatting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4964,7 +4964,7 @@ function map_deep( $value, $callback ) {
49644964
* @param array $array Variables will be stored in this array.
49654965
*/
49664966
function wp_parse_str( $string, &$array ) {
4967-
parse_str( $string, $array );
4967+
parse_str( (string) $string, $array );
49684968

49694969
/**
49704970
* Filters the array of variables derived from a parsed string.

0 commit comments

Comments
 (0)