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';
28 public static function validate($a_html, $a_mode)
31 if (!
defined(
'UPLOAD_ERR_CANT_WRITE')) {
32 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));
48 $lang = isset($_REQUEST[
'lang']) ? $_REQUEST[
'lang'] :
'en';
60 require
'./Services/XHTMLValidator/validator/local/en.inc';
73 if ($a_mode ==
"accessibility") {
77 $validator =
new validator(
$options);
80 $result = $validator->parse_string($a_html);
84 if ($validator->internal_error()) {
85 $answer.=
"<p>$message[13]:<br />\n";
86 $answer.= nl2br($validator->internal_errors_string()) .
"</p>\n";
93 if ($detected_version = $validator->detected_version()) {
94 $answer.=
"<strong>$message[14]</strong>: $detected_version<br />\n";
98 $answer.=
"<strong>$message[20]</strong>: {$validator->readable_charset()}";
101 if ($validator->lang) {
102 $answer.=
"<br />\n<strong>$message[24]</strong>: {$langs[$validator->lang]}";
107 if (
$errors = $validator->error()) {
108 $answer.=
"<br />\n<strong>$message[21]</strong>: $errors</p>\n" .
109 "<h2>$message[16]</h2>\n";
111 if (empty($_REQUEST[
'errors']) || $_REQUEST[
'errors'] ==
'along') {
112 $answer.=
'<code>' . $validator->errors_source() .
"</code>\n\n";
114 $answer.=
'<p>' . $validator->errors_string() .
"</p>\n\n";
119 $answer.=
"</p><p>$message[15]</p>\n";
124 if (!isset($_REQUEST[
'repair']) || $_REQUEST[
'repair'] ==
'full') {
125 $html = strtr(nl2br(htmlspecialchars($validator->repaired_source(), ENT_QUOTES,
'UTF-8')),
array(
' ' =>
' '));
127 $answer.=
"\n<p> </p>\n<h2>$message[17]</h2>\n";
128 $answer.=
'<div class="code"><code>' .
$html .
"</code></div>\n";
143 $answer.=
"<p>$message[13]:<br />\n";
144 $answer.= nl2br($validator->internal_errors_string()) .
"</p>\n";
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static validate($a_html, $a_mode)
Create styles array
The data for the language used.
Adapter Class for XHTML Validator.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options