Fix deprecation notice in coming soon and store-only mode (#51474)

* Wrap parse_str under a check

* Changelog
This commit is contained in:
Ilyas Foo 2024-09-18 18:06:38 +08:00 committed by GitHub
parent d6f1cce424
commit 6a83e8d301
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Wrap parse_str under a check to resolve deprecation notice

View File

@ -154,11 +154,13 @@ class WCAdminHelper {
'post_type' => 'product',
);
parse_str( wp_parse_url( $url, PHP_URL_QUERY ), $url_params );
foreach ( $params as $key => $param ) {
if ( isset( $url_params[ $key ] ) && $url_params[ $key ] === $param ) {
return true;
$query_string = wp_parse_url( $url, PHP_URL_QUERY );
if ( $query_string ) {
parse_str( $query_string, $url_params );
foreach ( $params as $key => $param ) {
if ( isset( $url_params[ $key ] ) && $url_params[ $key ] === $param ) {
return true;
}
}
}