Skip to content
Extraits de code Groupes Projets
Valider 506ff073 rédigé par esj's avatar esj
Parcourir les fichiers

Conformité XHTML du débusqueur/validateur, pb essentiellement du à...

Conformité XHTML du débusqueur/validateur, pb essentiellement du à highlight_string qui utilise la balise obsolète Font. De plus, cette fonction ne colorie plus le code après une balise /script, c'est à présent contourné.

Correction d'un bug dans le cartouche "meme_rubrique: le nombre d'articles non affichés était négatif.
parent 6659155c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -1799,7 +1799,7 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30, $ajax ...@@ -1799,7 +1799,7 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30, $ajax
$voss = spip_query($query . " ORDER BY $order DESC LIMIT $limit"); $voss = spip_query($query . " ORDER BY $order DESC LIMIT $limit");
$limit -= $n; $limit = $n - $limit;
$retour = ''; $retour = '';
$fstatut = 'puce_statut_' . $type; $fstatut = 'puce_statut_' . $type;
...@@ -1824,7 +1824,8 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30, $ajax ...@@ -1824,7 +1824,8 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30, $ajax
$retour = bandeau_titre_boite2($icone, 'article-24.gif','','',false) $retour = bandeau_titre_boite2($icone, 'article-24.gif','','',false)
. "\n<table style='font-size: 11px; background-color: #e0e0e0;border: 0px; padding-left:4px;'>" . "\n<table style='font-size: 11px; background-color: #e0e0e0;border: 0px; padding-left:4px;'>"
. $retour . $retour
. (($limit > 0) ? '' : "<tr><td colspan='3' style='text-align: center'>+ $limit</td></tr>") . (($limit >= 0) ? ''
: "<tr><td colspan='3' style='text-align: center'>+ $limit</td></tr>")
. "</table>"; . "</table>";
if ($ajax) return $retour; if ($ajax) return $retour;
......
...@@ -95,8 +95,8 @@ function erreur_requete_boucle($query, $id_boucle, $type, $errno, $erreur) { ...@@ -95,8 +95,8 @@ function erreur_requete_boucle($query, $id_boucle, $type, $errno, $erreur) {
. $type . ")</blink><br />\n" . $type . ")</blink><br />\n"
. "<b>"._T('avis_erreur_mysql')."</b><br />\n" . "<b>"._T('avis_erreur_mysql')."</b><br />\n"
. htmlspecialchars($query) . htmlspecialchars($query)
. "\n<br /><font color='red'><b>".htmlspecialchars($erreur) . "\n<br /><span style='color: red'><b>".htmlspecialchars($erreur)
. "</b></font><br />" . "</b></span><br />"
. "<blink>&lt;/BOUCLE".$id_boucle."&gt;</blink></tt>\n"; . "<blink>&lt;/BOUCLE".$id_boucle."&gt;</blink></tt>\n";
include_spip('inc/minipres'); include_spip('inc/minipres');
...@@ -308,18 +308,26 @@ function ancre_texte($texte, $fautifs=array()) ...@@ -308,18 +308,26 @@ function ancre_texte($texte, $fautifs=array())
global $var_mode_ligne; global $var_mode_ligne;
if ($var_mode_ligne) $fautifs[]= array($var_mode_ligne); if ($var_mode_ligne) $fautifs[]= array($var_mode_ligne);
$res =''; $res ='';
$s = highlight_string($texte,true); $s = highlight_string(str_replace('</script>','</@@@@@>',$texte),true);
$s = str_replace('/@@@@@','/script', // bug de highlight_string
str_replace('</font>','</span>',
str_replace('<font color="','<span style="color: ', $s)));
if (substr($s,0,6) == '<code>') { $s=substr($s,6); $res = '<code>';} if (substr($s,0,6) == '<code>') { $s=substr($s,6); $res = '<code>';}
$s = preg_replace(',<(\w[^<>]*)>([^<]*)<br />([^<]*)</\1>,',
'<\1>\2</\1><br />' . "\n" . '<\1>\3</\1>',
$s);
$tableau = explode("<br />", $s); $tableau = explode("<br />", $s);
$ancre = md5($texte); $ancre = md5($texte);
$n = strlen(count($tableau)); $n = strlen(count($tableau));
$format = "<a href='#T%s'><span id='L%d' style='text-align: right;color: black;'>%0" $format = "<a href='#T%s'><span id='L%d' style='text-align: right;color: black;%s'>%0"
. strval($n) . strval($n)
. "d&nbsp;&nbsp;</span></a>\n"; . "d&nbsp;&nbsp;</span></a>\n";
$format10=str_replace('black','pink',$format); $format10=str_replace('black','pink',$format);
$formaterr="<span style='background-color: pink'>%s</span>"; $formaterr="background-color: pink;";
$i=1; $i=1;
$flignes = array(); $flignes = array();
...@@ -340,10 +348,10 @@ function ancre_texte($texte, $fautifs=array()) ...@@ -340,10 +348,10 @@ function ancre_texte($texte, $fautifs=array())
// $m = $flignes[$i][0]; // $m = $flignes[$i][0];
// $ligne = substr($ligne, 0, $m-1) . // $ligne = substr($ligne, 0, $m-1) .
// sprintf($formaterr, substr($ligne,$m)); // sprintf($formaterr, substr($ligne,$m));
$ligne = sprintf($formaterr, $ligne); $bg = $formaterr;
} else $indexmesg = $ancre; } else {$indexmesg = $ancre; $bg='';}
$res .= "<br />\n" $res .= "<br />\n"
. sprintf((($i%10) ? $format :$format10), $indexmesg, $i, $i) . sprintf((($i%10) ? $format :$format10), $indexmesg, $i, $bg, $i)
. $ligne; . $ligne;
$i++; $i++;
} }
...@@ -478,12 +486,16 @@ function debug_script ($t) { ...@@ -478,12 +486,16 @@ function debug_script ($t) {
debug_debut($GLOBALS['exec']); debug_debut($GLOBALS['exec']);
if (!isset($GLOBALS['xhtml_error'])) { if (!isset($GLOBALS['xhtml_error'])) {
$err = '<h3>' . _L('SPIP consid&egrave;re ce document comme conforme &agrave; son DOCTYPE&nbsp;: <br />') . list ($top, $avail, $grammaire, $rotlvl) = analyser_doctype($t);
substr($t,9,strpos($t,'>')-9) $err = '<h3>' . _L('SPIP consid&egrave;re ce document comme conforme &agrave; son DOCTYPE&nbsp;:')
.'</h3>'; . "<br /><a href='"
$t =''; . $grammaire
. "'>"
. $rotlvl
. '</a></h3>';
$t ='';
} else { } else {
list($t, $err) = emboite_texte($t); list($t, $err) = emboite_texte($t);
} }
echo "<div style='text-align: center'><h1>", _T('analyse_xml') . '</h1>', echo "<div style='text-align: center'><h1>", _T('analyse_xml') . '</h1>',
...@@ -494,8 +506,7 @@ function debug_script ($t) { ...@@ -494,8 +506,7 @@ function debug_script ($t) {
. _T("access_interface_graphique") . _T("access_interface_graphique")
. "</a></div>"; . "</a></div>";
echo $t; echo $t;
echo "\n</div>"; echo "\n</div></div></body></html>";
echo '</body></html>';
} }
// http://doc.spip.org/@debug_debut // http://doc.spip.org/@debug_debut
...@@ -513,8 +524,11 @@ function debug_debut($titre) ...@@ -513,8 +524,11 @@ function debug_debut($titre)
_T('admin_debug') . ' ' . $titre . ' (' . _T('admin_debug') . ' ' . $titre . ' (' .
supprimer_tags(extraire_multi($GLOBALS['meta']['nom_site']))), supprimer_tags(extraire_multi($GLOBALS['meta']['nom_site']))),
")</title>\n", ")</title>\n",
"<meta http-equiv='Content-Type' content='text/html",
(($c = $GLOBALS['meta']['charset']) ? "; charset=$c" : ''),
"' />\n",
"<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css')) "<link rel='stylesheet' href='".url_absolue(find_in_path('spip_admin.css'))
. "' type='text/css'>", . "' type='text/css' />",
"</head>\n<body style='margin:0 10px;'>", "</head>\n<body style='margin:0 10px;'>",
"\n<div id='spip-debug' style='position: absolute; top: 22px; z-index: 1000;height:97%;left:10px;right:10px;'><div id='spip-boucles'>\n"; "\n<div id='spip-debug' style='position: absolute; top: 22px; z-index: 1000;height:97%;left:10px;right:10px;'><div id='spip-boucles'>\n";
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter