This repository was archived by the owner on Jul 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathxoxovalid.php
More file actions
executable file
·36 lines (32 loc) · 1.46 KB
/
xoxovalid.php
File metadata and controls
executable file
·36 lines (32 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
require_once 'OutlineClasses/OutlineFromXOXO.php';
require_once 'xn-app://singpolymaplay/getTidy.php';
if($_GET['url']) {
if($_GET['url'] == 'refer') $_GET['url'] = $_SERVER['HTTP_REFERRER'];
$data = file_get_contents($_GET['url']);
} elseif($_GET['data']) {
$data = $_GET['data'];
} else {
?>
<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>"><div>
Enter a<br />
URL: <input type="text" name="url" /><br />
or<br />
Data: <textarea name="data"></textarea><br />
<input type="submit" name="submit" value="Validate!" />
</div></form>
<?php
exit;
}//end if-elseif-else
$struct = new OutlineFromXOXO($data);
if($struct->getError()) {
echo '<h2 style="text-align:center;"><a href="http://www.hcrc.ed.ac.uk/~richard/xml-check.cgi?url='.urlencode($_GET['url']).'">Not Valid XML!</a> -- '.xml_error_string($struct->getError()) . ' -- Error #' . $struct->getError().'</h2>';
$data = getTidy($_GET['url']);
$struct = new OutlineFromXOXO($data);
}//end if error
if($struct->getNumNodes() || count($struct->getFields())) {
echo '<h2 style="text-align:center;">Valid <a href="http://microformats.org/wiki/xoxo">XOXO</a> data found!</h2>';
} else {
echo '<h2 style="text-align:center;">No valid <a href="http://microformats.org/wiki/xoxo">XOXO</a> data found</h2>';
}//end if count || count
?>