mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix psalm
This commit is contained in:
parent
035ff32d59
commit
2b4f77818b
2 changed files with 5 additions and 3 deletions
|
@ -347,8 +347,11 @@ class PayUponInvoice {
|
|||
}
|
||||
|
||||
$national_number = filter_input( INPUT_POST, 'billing_phone', FILTER_SANITIZE_STRING );
|
||||
if ( $national_number && ! preg_match( '/^[0-9]{1,14}?$/', preg_replace( '/[^0-9]/', '', $national_number ) ) ) {
|
||||
$errors->add( 'validation', __( 'Phone number size must be between 1 and 14', 'woocommerce-paypal-payments' ) );
|
||||
if ( $national_number ) {
|
||||
$numeric_phone_number = preg_replace( '/[^0-9]/', '', $national_number );
|
||||
if ( $numeric_phone_number && ! preg_match( '/^[0-9]{1,14}?$/', $numeric_phone_number ) ) {
|
||||
$errors->add( 'validation', __( 'Phone number size must be between 1 and 14', 'woocommerce-paypal-payments' ) );
|
||||
}
|
||||
}
|
||||
},
|
||||
10,
|
||||
|
|
|
@ -256,7 +256,6 @@ class WCGatewayModule implements ModuleInterface {
|
|||
$logger->error( $message );
|
||||
$wc_order->update_status( 'failed', $message );
|
||||
}
|
||||
|
||||
},
|
||||
10,
|
||||
2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue