From 1d010cf34f331ca08c60548b88ef1461ecb69b87 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 10 Jan 2025 09:56:38 +0100 Subject: [PATCH] Mute psalm bc ignores wc_clean --- src/Payment/MollieObject.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Payment/MollieObject.php b/src/Payment/MollieObject.php index 135e144c..d8054d3f 100644 --- a/src/Payment/MollieObject.php +++ b/src/Payment/MollieObject.php @@ -1108,7 +1108,9 @@ private function checkBillieCompanyField($order) } $isBillieMethodId = $gateway->id === 'mollie_wc_gateway_billie'; if ($isBillieMethodId) { - $company = wc_clean(wp_unslash($_POST["billing_company_billie"] ?? '')) ?: $order->get_billing_company( + //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $fieldPosted = wc_clean(wp_unslash($_POST["billing_company_billie"] ?? '')); + $company = $fieldPosted ?: $order->get_billing_company( ) ?: $order->get_shipping_company(); return $company ? $this->maximalFieldLengths($company, self::MAXIMAL_LENGTH_ADDRESS) : null; }