Skip to content

Commit aaed06f

Browse files
committed
Update usage of filter_* functions.
1 parent 53dd567 commit aaed06f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Extension.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,18 +1073,20 @@ public function fulfill_order( $entry ) {
10731073
* @return void
10741074
*/
10751075
public function maybe_display_confirmation() {
1076-
if ( ! filter_has_var( INPUT_GET, 'pay_confirmation' ) ) {
1076+
// phpcs:disable WordPress.Security.NonceVerification.Recommended
1077+
if ( ! \array_key_exists( 'pay_confirmation', $_GET ) ) {
10771078
return;
10781079
}
10791080

1080-
// Verify hash.
1081-
if ( ! filter_has_var( INPUT_GET, 'hash' ) ) {
1081+
$payment_id = (int) \sanitize_text_field( \wp_unslash( $_GET['pay_confirmation'] ) );
1082+
1083+
if ( ! \array_key_exists( 'hash', $_GET ) ) {
10821084
return;
10831085
}
10841086

1085-
$hash = \sanitize_text_field( \wp_unslash( filter_input( INPUT_GET, 'hash' ) ) );
1087+
$hash = \sanitize_text_field( \wp_unslash( $_GET['hash'] ) );
10861088

1087-
$payment_id = filter_input( INPUT_GET, 'pay_confirmation', FILTER_SANITIZE_NUMBER_INT );
1089+
// phpcs:enable WordPress.Security.NonceVerification.Recommended
10881090

10891091
if ( \wp_hash( $payment_id ) !== $hash ) {
10901092
return;

0 commit comments

Comments
 (0)