From 0e1a85ca7558a9ec6f2e708dcc106c455a50776d Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Thu, 2 Jun 2022 07:43:05 -0400 Subject: gitweb: switch to an XHTML5 DOCTYPE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the HTML Standard FAQ: “What is the DOCTYPE for modern HTML documents? In text/html documents: In documents delivered with an XML media type: no DOCTYPE is required and its use is generally unnecessary. However, you may use one if you want (see the following question). Note that the above is well-formed XML.” Source: [1] Gitweb uses an XHTML 1.0 DOCTYPE: While that DOCTYPE is still valid [2], it has several disadvantages: 1. It’s misleading. If an XML parser uses the DTD at the given link, then the entities   and ⋅ won’t get declared. Instead, the parser has to use a DTD from the HTML Standard that has nothing to do with XHTML 1.0 [2]. 2. It’s obsolete. XHTML 1.0 was last revised in 2002 and was superseded in 2018 [3]. 3. It’s unreliable. Gitweb uses   and ⋅ but lets an external file define them. “[…U]using entity references for characters in XML documents is unsafe if they are defined in an external file (except for <, >, &, ", and ').” [4] [1]: [2]: [3]: [4]: Signed-off-by: Jason Yundt Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gitweb') diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 606b50104c..1835487ab2 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -4219,7 +4219,10 @@ sub git_header_html { my $mod_perl_version = $ENV{'MOD_PERL'} ? " $ENV{'MOD_PERL'}" : ''; print < - + + +]> -- cgit v1.2.3