<commit_before><?php
$inc_class_util = true;
$inc_class_ua = true;
include("inchandler.inc");

$wrapper->pgtop("KaiRo's Browser-Test");

$httpvars = $util->getHTTPvars();
if (strlen($httpvars["ua"])) {
  $ua = new userAgent($httpvars["ua"]);
}
else {
  $ua = new userAgent;
}

print("<h1>KaiRo's Browser-Test</h1>\n");

print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n<br>");
print("<b>".$ua->uastring."</b>\n");

print("<br><br>This is <b>".($ua->isns()?"a":"no")."</b> Netscape browser.\n");
print("<br>This is <b>".($ua->isns4()?"a":"no")."</b> Netscape Communicator 4 browser.\n");
print("<br>This is <b>".($ua->isie()?"an":"no")."</b> Internet Explorer browser.\n");
print("<br>This is <b>".($ua->geckobased()?"a":"no")."</b> Gecko-based browser.\n");
print("<br>This is <b>".($ua->khtmlbased()?"a":"no")."</b> KHTML-based browser.\n");
print("<br>This is <b>".($ua->isbot()?"an":"no")."</b> automated robot.\n");
print("<br>The browser brand is reported as &quot;<b>".$ua->getBrand()."</b>&quot;\n");
print("<br>The browser version is reported as &quot;<b>".$ua->getVersion()."</b>&quot;\n");
if ($ua->geckobased()) { print("<br>The Gecko date is reported as &quot;<b>".$ua->geckodate()."</b>&quot;\n"); }
print("<br><br>I conclude this must be <b>".$ua->getBrand()." ".$ua->getVersion()."</b>\n");

print("<br><br>Test the following UA string (leave empty to read it from your browser):\n");
print("<form method=\"POST\" action=\"\"><p>\n");
print("<input type=\"text\" name=\"ua\" value=\"".$ua->uastring."\" size=\"80\" maxlength=\"150\">\n");
print("<br><input type=\"submit\" value=\"Test\"></p></form>\n");

$wrapper->pgbottom();
?><commit_msg>update testbed<commit_after><?php
$inc_class_util = true;
$inc_class_ua = true;
include("inchandler.inc");

$wrapper->pgtop("KaiRo's Browser-Test");

$httpvars = $util->getHTTPvars();
if (strlen($httpvars["ua"])) {
  $ua = new userAgent($httpvars["ua"]);
}
else {
  $ua = new userAgent;
}

print("<h1>KaiRo's Browser-Test</h1>\n");

print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n<br>");
print("<b>".$ua->getUAString()."</b>\n");

print("<br><br>The browser brand is reported as &quot;<b>".$ua->getBrand()."</b>&quot;\n");
print("<br>The browser version is reported as &quot;<b>".$ua->getVersion()."</b>&quot;\n");
print("<br>The browser engine is reported as &quot;<b>".$ua->getEngine()."</b>&quot;\n");
print("<br>The engine version is reported as &quot;<b>".$ua->getEngineVersion()."</b>&quot;\n");
print("<br>The operating system is reported as &quot;<b>".$ua->getOS()."</b>&quot;\n");
print("<br>The system platform is reported as &quot;<b>".$ua->getPlatform()."</b>&quot;\n");
print("<br>The browser language is reported as &quot;<b>".$ua->getLanguage()."</b>&quot;\n");
if ($ua->geckobased()) { print("<br>The Gecko date is reported as &quot;<b>".$ua->getGeckoDate()."</b>&quot;\n"); }
print("<br><br>I conclude this must be <b>".$ua->getBrand()." ".$ua->getVersion()."</b>\n");
print("<br>This is <b>".($ua->isBot()?"an":"no")."</b> automated robot.\n");

$acclang = $ua->getAcceptLanguages();
print("<br><br>Accepted Languages: ");
foreach ($acclang as $lang=>$q) { print($lang."(".$q.") "); }
print("\n");

print("<br><br>Test the following UA string (leave empty to read it from your browser):\n");
print("<form method=\"POST\" action=\"\"><p>\n");
print("<input type=\"text\" name=\"ua\" value=\"".htmlentities($ua->uastring)."\" size=\"80\" maxlength=\"150\">\n");
print("<br><input type=\"submit\" value=\"Test\"></p></form>\n");
$wrapper->pgbottom();
?>
{'fraction_non_alphanumeric': 0.30073952341824156, 'fraction_numerical': 0.004382360996987127, 'mean_word_length': 6.023076923076923, 'pattern_counts': {'":': 11, '<': 99, '<?xml version=': 0, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2599557', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1335, 'n_words': 262}