5 require_once
'./Services/XHTMLValidator/validator/config.inc';
9 require_once
'./Services/XHTMLValidator/validator/Text_Diff/Diff.php';
10 require_once
'./Services/XHTMLValidator/validator/Text_Diff/Renderer.php';
11 require_once
'./Services/XHTMLValidator/validator/Text_Diff/unified.php';
13 require_once
'./Services/XHTMLValidator/validator/include.inc';
14 require_once
'./Services/XHTMLValidator/validator/validator.inc';
32 if (!defined(
'UPLOAD_ERR_CANT_WRITE'))
33 define(
'UPLOAD_ERR_CANT_WRITE', 7);
40 define(
'MOZILLA', (isset($_SERVER[
'HTTP_USER_AGENT']) && strpos($_SERVER[
'HTTP_USER_AGENT'],
'Mozilla/') !==
false && strpos($_SERVER[
'HTTP_USER_AGENT'],
'Gecko/') !==
false));
60 require
'./Services/XHTMLValidator/validator/local/en.inc';
72 $options[
"charset"] =
"utf8";
73 if ($a_mode ==
"accessibility")
75 $options[
"accessibility-check"] = 3;
78 $validator =
new validator($options);
81 $result = $validator->parse_string($a_html);
86 if ($validator->internal_error()) {
87 $answer.=
"<p>$message[13]:<br />\n";
88 $answer.= nl2br($validator->internal_errors_string()) .
"</p>\n";
95 if ($detected_version = $validator->detected_version()) {
96 $answer.=
"<strong>$message[14]</strong>: $detected_version<br />\n";
100 $answer.=
"<strong>$message[20]</strong>: {$validator->readable_charset()}";
103 if ($validator->lang)
104 $answer.=
"<br />\n<strong>$message[24]</strong>: {$langs[$validator->lang]}";
108 if (
$errors = $validator->error()) {
110 $answer.=
"<br />\n<strong>$message[21]</strong>: $errors</p>\n".
111 "<h2>$message[16]</h2>\n";
114 $answer.=
'<code>' . $validator->errors_source() .
"</code>\n\n";
117 $answer.=
'<p>' . $validator->errors_string() .
"</p>\n\n";
122 $answer.=
"</p><p>$message[15]</p>\n";
128 $html = strtr(nl2br(htmlspecialchars($validator->repaired_source(), ENT_QUOTES,
'UTF-8')), array(
' ' =>
' '));
130 $answer.=
"\n<p> </p>\n<h2>$message[17]</h2>\n";
131 $answer.=
'<div class="code"><code>' . $html .
"</code></div>\n";
146 $answer.=
"<p>$message[13]:<br />\n";
147 $answer.= nl2br($validator->internal_errors_string()) .
"</p>\n";