-
Notifications
You must be signed in to change notification settings - Fork 2
/
viewlog.php
36 lines (36 loc) · 935 Bytes
/
viewlog.php
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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>body{background:white;}</style>
</head>
<body>
<div style="font-family: monospace; font-size: 14px;">
<?php
$backgrounds = array(
0 => '#ffdddd',
1 => '#ffffff',
);
$lines = file($_GET['l']);
foreach ($lines as $outerkey=>$l) {
$words = split('[ ]', $l);
$nick = $words[1];
$nick = split('[:]',$nick)[0];
foreach ($words as $key=>$w) {
if ((stripos($w, 'http') === 0) || (stripos($w, 'ftp') === 0)) {
if ((stripos($w, '://') > 2) && (stripos($w, '://') < 6)) {
$words[$key] = '<a href="'.$words[$key].'">' .$words[$key]. '</a>';
}
} else {
$words[$key] = htmlspecialchars($words[$key]);
}
};
$l = implode(' ', $words);
echo '<div style="margin:0px;color:black;';
echo 'background:' . $backgrounds[$outerkey%2] . ';';
echo '">' . $l . '</div>';
}
//VAR_DUMP($lines);
?>
</div>
</body>
</html>