From 71eded0471f0c4f200ffa74094e2c3809d9a1090 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Fri, 15 Nov 2024 20:04:23 +0300 Subject: [PATCH] LibCore: Recognize .xht as XHTML in MIME parser for file names Fixes a bug when https://wpt.live/css/CSS2/positioning/abspos-001.xht saved as file fails because we incorrectly recognized its MIME type as HTML, leading to incorrect self-closing tag handling and thus incorrect rendering. --- Libraries/LibCore/MimeData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibCore/MimeData.cpp b/Libraries/LibCore/MimeData.cpp index 699ac0b46e4..2db56794280 100644 --- a/Libraries/LibCore/MimeData.cpp +++ b/Libraries/LibCore/MimeData.cpp @@ -79,7 +79,7 @@ static Array const s_registered_mime_type = { MimeType { .name = "application/x-blender"sv, .common_extensions = { ".blend"sv, ".blended"sv }, .description = "Blender project file"sv, .magic_bytes = Vector { 'B', 'L', 'E', 'N', 'D', 'E', 'R' } }, MimeType { .name = "application/x-bzip2"sv, .common_extensions = { ".bz2"sv }, .description = "BZIP2 compressed data"sv, .magic_bytes = Vector { 'B', 'Z', 'h' } }, MimeType { .name = "application/x-sheets+json"sv, .common_extensions = { ".sheets"sv }, .description = "Serenity Spreadsheet document"sv }, - MimeType { .name = "application/xhtml+xml"sv, .common_extensions = { ".xhtml"sv }, .description = "XHTML document"sv }, + MimeType { .name = "application/xhtml+xml"sv, .common_extensions = { ".xhtml"sv, ".xht"sv }, .description = "XHTML document"sv }, MimeType { .name = "application/zip"sv, .common_extensions = { ".zip"sv }, .description = "ZIP archive"sv, .magic_bytes = Vector { 0x50, 0x4B } }, MimeType { .name = "audio/flac"sv, .common_extensions = { ".flac"sv }, .description = "FLAC audio"sv, .magic_bytes = Vector { 'f', 'L', 'a', 'C' } },