From 75854fdbd2856a776569c65ef4af87910ce5b257 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Tue, 16 Dec 2025 13:59:37 -0700 Subject: [PATCH 1/2] MIME: Introduce MIME type parser (#10640) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Various applications require making decisions based on a MIME type from an HTTP header, such as is found in the “Content-Type” header. This patch introduces a new utility class for parsing MIME media types compliant with the WHATWG MIME Sniffing algorithm. Co-authored-by: Jon Surrell --- src/wp-includes/class-wp-mime-type.php | 366 +++++++++++++++++++++++++ 1 file changed, 366 insertions(+) create mode 100644 src/wp-includes/class-wp-mime-type.php diff --git a/src/wp-includes/class-wp-mime-type.php b/src/wp-includes/class-wp-mime-type.php new file mode 100644 index 0000000000000..5d75ea006a7e0 --- /dev/null +++ b/src/wp-includes/class-wp-mime-type.php @@ -0,0 +1,366 @@ +is_json() ) { + * echo '