Skip to content

Commit

Permalink
Use JSON-encoding instead of PHP serialization
Browse files Browse the repository at this point in the history
Co-authored-by: Shyamsundar Gadde <[email protected]>
  • Loading branch information
westonruter and ShyamGadde authored Dec 1, 2024
1 parent 4f0ac4c commit ae3eab0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/optimization-detective/storage/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}

/**
Expand Down

0 comments on commit ae3eab0

Please sign in to comment.