Skip to content

Commit 7733b23

Browse files
PHP Compat: Set flags for html_entity_decode(). (#795)
* Set flags for html_entity_decode() to PHP 8.1 defaults. * Tests: Optional params must follow required params.
1 parent 70b8eec commit 7733b23

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/integration/API/CacheableAPIBaseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function provider_get_request_transient_key(): array {
267267
*
268268
* @throws ReflectionException
269269
*/
270-
public function test_is_request_cacheable( bool $is_cacheable, $filter_value = null, bool $expected ) {
270+
public function test_is_request_cacheable( bool $is_cacheable, $filter_value, bool $expected ) {
271271

272272
$api = $this->get_new_api_instance_with_request( $this->get_new_request_instance( $is_cacheable ) );
273273

@@ -313,7 +313,7 @@ public function provider_is_request_cacheable(): array {
313313
*
314314
* @throws ReflectionException
315315
*/
316-
public function test_get_request_cache_lifetime( int $lifetime, $filter_value = null, int $expected ) {
316+
public function test_get_request_cache_lifetime( int $lifetime, $filter_value, int $expected ) {
317317

318318
$api = $this->get_new_api_instance_with_request( $this->get_new_request_instance()->set_cache_lifetime( $lifetime ) );
319319

woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public function ajax_process_capture() {
410410
}
411411

412412
wp_send_json_success( [
413-
'message' => html_entity_decode( wp_strip_all_tags( $result['message'] ) ), // ensure any HTML tags are removed and the currency symbol entity is decoded
413+
'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
414414
] );
415415

416416
} catch ( SV_WC_Payment_Gateway_Exception $e ) {

0 commit comments

Comments
 (0)