From ae3eab0b393d32da8929c87fd25ec8a63df29ef0 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sat, 30 Nov 2024 20:34:59 -0800 Subject: [PATCH] Use JSON-encoding instead of PHP serialization Co-authored-by: Shyamsundar Gadde --- plugins/optimization-detective/storage/data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/optimization-detective/storage/data.php b/plugins/optimization-detective/storage/data.php index d9c561efb..17e2f51f2 100644 --- a/plugins/optimization-detective/storage/data.php +++ b/plugins/optimization-detective/storage/data.php @@ -157,7 +157,7 @@ function od_get_current_etag( OD_Tag_Visitor_Registry $tag_visitor_registry ): s $data = array( 'tag_visitors' => array_keys( iterator_to_array( $tag_visitor_registry ) ), ); - return md5( serialize( $data ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize + return md5( (string) wp_json_encode( $data ) ); } /**