From 3973bd4a3ba7df9dce02ab91185691a70be565c7 Mon Sep 17 00:00:00 2001 From: dinamiko Date: Mon, 20 Jun 2022 10:39:18 +0200 Subject: [PATCH] Fix psalm --- .../src/Gateway/PayUponInvoice/PayUponInvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php index 0b056b7fb..469a1f62f 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php @@ -347,7 +347,7 @@ class PayUponInvoice { } $national_number = filter_input( INPUT_POST, 'billing_phone', FILTER_SANITIZE_STRING ); - if ( ! preg_match( '/^[0-9]{1,14}?$/', $national_number ) ) { + if ( $national_number && ! preg_match( '/^[0-9]{1,14}?$/', $national_number ) ) { $errors->add( 'validation', __( 'Phone number size must be between 1 and 14', 'woocommerce-paypal-payments' ) ); } },