mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Use filter_var for REQUEST_URI
In some cases filter_input returns NULL for server variables even though they are present. Such as this bug https://bugs.php.net/bug.php?id=49184, though not only in CLI. At least in our DDEV it happens here.
This commit is contained in:
parent
6771d978ec
commit
a220396fcc
1 changed files with 2 additions and 1 deletions
|
@ -58,7 +58,8 @@ class CustomerApprovalListener {
|
|||
return;
|
||||
}
|
||||
|
||||
$url = (string) filter_input( INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL );
|
||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
|
||||
$url = (string) filter_var( $_SERVER['REQUEST_URI'] ?? '', FILTER_SANITIZE_URL );
|
||||
|
||||
$query = wp_parse_url( $url, PHP_URL_QUERY );
|
||||
if ( $query && str_contains( $query, 'ppcp_vault=cancel' ) ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue