From d53810f150b34d45bc133347445ec69cb7a354ab Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Wed, 3 Dec 2025 10:32:27 +1100 Subject: [PATCH 1/2] Set flags for html_entity_decode() to PHP 8.1 defaults. --- .../admin/class-sv-wc-payment-gateway-admin-order.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php index d0e22c024..e04f73921 100644 --- a/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php +++ b/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php @@ -410,7 +410,7 @@ public function ajax_process_capture() { } wp_send_json_success( [ - 'message' => html_entity_decode( wp_strip_all_tags( $result['message'] ) ), // ensure any HTML tags are removed and the currency symbol entity is decoded + 'message' => html_entity_decode( wp_strip_all_tags( $result['message'] ), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ), // ensure any HTML tags are removed and the currency symbol entity is decoded ] ); } catch ( SV_WC_Payment_Gateway_Exception $e ) { From 851973a39bb1631e250601e0c6006f31cadeaf50 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Wed, 3 Dec 2025 10:34:22 +1100 Subject: [PATCH 2/2] Tests: Optional params must follow required params. --- tests/integration/API/CacheableAPIBaseTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/API/CacheableAPIBaseTest.php b/tests/integration/API/CacheableAPIBaseTest.php index 563060743..e8585ce61 100644 --- a/tests/integration/API/CacheableAPIBaseTest.php +++ b/tests/integration/API/CacheableAPIBaseTest.php @@ -267,7 +267,7 @@ public function provider_get_request_transient_key(): array { * * @throws ReflectionException */ - public function test_is_request_cacheable( bool $is_cacheable, $filter_value = null, bool $expected ) { + public function test_is_request_cacheable( bool $is_cacheable, $filter_value, bool $expected ) { $api = $this->get_new_api_instance_with_request( $this->get_new_request_instance( $is_cacheable ) ); @@ -313,7 +313,7 @@ public function provider_is_request_cacheable(): array { * * @throws ReflectionException */ - public function test_get_request_cache_lifetime( int $lifetime, $filter_value = null, int $expected ) { + public function test_get_request_cache_lifetime( int $lifetime, $filter_value, int $expected ) { $api = $this->get_new_api_instance_with_request( $this->get_new_request_instance()->set_cache_lifetime( $lifetime ) );