summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-04-25 21:09:50 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-04-26 22:56:28 +0200
commitd9c506df8528c2db84d724048f9bc578605f9a3f (patch)
tree3f416c1e0575b1cabd05fa1d4647e252ca56207c
parentd10b35011731b4660e7b796b1e19a44144c63a3c (diff)
Recognize *.xhtml documents as HTML too
The file plugin was not able to detect XHTML documents from files with the .xhtml extension if there are comments before the doctype line. Before falling back to reading the content, we directly specify the media type to HTML based on the extension alone. The basic content type detection algorithm is too simple and will continue to fail when comments are placed before the doctype line. Reported-by: Kevin Koster <dillo@ombertech.com> See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/message/HBKXGO7EGCHWOQ6BM55A4LZQKT437UID/
-rw-r--r--ChangeLog1
-rw-r--r--dpi/file.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 88c16e21..408c0ffd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@ dillo-3.1 [not released yet]
- Fix W3C validator and remove broken WDG validator.
- Simplify bookmark DPI page style and improve readability.
- Improve the Dillo manual available from the help button.
+ - Improve detection of XHTML documents
Patches: Rodrigo Arias Mallo <rodarima@gmail.com>
-----------------------------------------------------------------------------
diff --git a/dpi/file.c b/dpi/file.c
index 5fef5fb9..d84f4b64 100644
--- a/dpi/file.c
+++ b/dpi/file.c
@@ -511,6 +511,7 @@ static const char *File_ext(const char *filename)
} else if (!dStrAsciiCasecmp(e, "png")) {
return "image/png";
} else if (!dStrAsciiCasecmp(e, "html") ||
+ !dStrAsciiCasecmp(e, "xhtml") ||
!dStrAsciiCasecmp(e, "htm") ||
!dStrAsciiCasecmp(e, "shtml")) {
return "text/html";