From 373bc3038a7f2a2950f1bf744ef5ed9f5608f090 Mon Sep 17 00:00:00 2001
From: b_b <bruno@eliaz.fr>
Date: Thu, 6 Jul 2023 19:23:01 +0200
Subject: [PATCH] =?UTF-8?q?fix:=20balise=20`<meta=20charset=3D"#CHARSET">`?=
 =?UTF-8?q?=20r=C3=A9duite=20et=20valide=20HTML5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ref: #5667
---
 ecrire/inc/headers.php             | 2 +-
 ecrire/public/balises.php          | 2 +-
 ecrire/public/debusquer.php        | 4 +---
 prive/login.html                   | 2 +-
 prive/spip_pass.html               | 2 +-
 prive/squelettes/inclure/head.html | 5 ++---
 6 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/ecrire/inc/headers.php b/ecrire/inc/headers.php
index d16242b094..de92cc2210 100644
--- a/ecrire/inc/headers.php
+++ b/ecrire/inc/headers.php
@@ -104,7 +104,7 @@ function redirige_par_entete($url, $equiv = '', $status = 302) {
 <head>',
 	$equiv, '
 <title>HTTP ' . $status . '</title>
-' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset=' . $GLOBALS['meta']['charset'] . '">' : '') . '
+' . ((isset($GLOBALS['meta']['charset'])) ? '<meta charset="' . $GLOBALS['meta']['charset'] . '">' : '') . '
 </head>
 <body>
 <h1>HTTP ' . $status . '</h1>
diff --git a/ecrire/public/balises.php b/ecrire/public/balises.php
index 3328f3cafa..31a455e8ce 100644
--- a/ecrire/public/balises.php
+++ b/ecrire/public/balises.php
@@ -129,7 +129,7 @@ function balise_DESCRIPTIF_SITE_SPIP_dist($p) {
  * @link https://www.spip.net/4331
  * @example
  *     ```
- *     <meta http-equiv="Content-Type" content="text/html; charset=#CHARSET" />
+ *     <meta charset="#CHARSET" />
  *     ```
  *
  * @param Champ $p
diff --git a/ecrire/public/debusquer.php b/ecrire/public/debusquer.php
index 07c0863a78..08b080c1f0 100644
--- a/ecrire/public/debusquer.php
+++ b/ecrire/public/debusquer.php
@@ -858,9 +858,7 @@ function debusquer_entete($titre, $corps) {
 		_T('admin_debug') . ' ' . spip_htmlspecialchars($titre) . ' (' .
 		supprimer_tags(corriger_typo($GLOBALS['meta']['nom_site']))) .
 	")</title>\n" .
-	"<meta http-equiv='Content-Type' content='text/html" .
-	(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : '') .
-	"' />\n" .
+	($c = $GLOBALS['meta']['charset']) ? "<meta charset='$c' />\n" : '' .
 	http_script('', 'jquery.js')
 	. "<link rel='stylesheet' href='" . url_absolue(find_in_path('spip_admin.css'))
 	. "' type='text/css' />" .
diff --git a/prive/login.html b/prive/login.html
index e7d3a2706c..1a845479a5 100644
--- a/prive/login.html
+++ b/prive/login.html
@@ -6,7 +6,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" lang="#LANG" dir="#LANG_DIR">
 <head>
 <title>[(#NOM_SITE_SPIP|textebrut)]</title>
-<meta http-equiv="Content-Type" content="text/html; charset=#CHARSET" />
+<meta charset="#CHARSET" />
 <meta name="robots" content="none" />
 <meta name="viewport" content="width=device-width" />
 #INSERT_HEAD_CSS
diff --git a/prive/spip_pass.html b/prive/spip_pass.html
index 3076ec04c9..2aa23ab494 100644
--- a/prive/spip_pass.html
+++ b/prive/spip_pass.html
@@ -6,7 +6,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="#LANG" lang="#LANG" dir="#LANG_DIR">
 <head>
 <title><:pass_mot_oublie:> - [(#NOM_SITE_SPIP|textebrut)]</title>
-<meta http-equiv="Content-Type" content="text/html; charset=#CHARSET" />
+<meta charset="#CHARSET" />
 <meta name="robots" content="none" />
 <meta name="viewport" content="width=device-width" />
 #INSERT_HEAD_CSS
diff --git a/prive/squelettes/inclure/head.html b/prive/squelettes/inclure/head.html
index fb030c2077..632cf6f265 100644
--- a/prive/squelettes/inclure/head.html
+++ b/prive/squelettes/inclure/head.html
@@ -2,9 +2,8 @@
 Appel au script php en attendant de reecrire le head ici
 ]
 [<title>(#ENV{titre,''})</title>
-]
-<meta http-equiv="Content-Type" content="text/html[; charset=(#CONFIG{charset})]" />
-<script>
+][<meta charset=(#CONFIG{charset})" />
+]<script>
 var url_menu_rubrique="[(#VAL{menu_rubriques}|generer_url_action{[date=(#CONFIG{date_calcul_rubriques})],1})]";
 (function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);
 [(#EVAL{$_COOKIE}|table_valeur{spip_accepte_ajax}|>={1}|non)
-- 
GitLab