Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 786 Bytes

index.php

File metadata and controls

31 lines (25 loc) · 786 Bytes
 
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
<?php
$arg = preg_replace('/\A\/finger\//', '', $_SERVER['REQUEST_URI']);
$arg = 'user=' . preg_replace('/\?/', '&', $arg);
putenv("SERVER_NAME=${_SERVER['SERVER_NAME']}");
putenv("QUERY_STRING=$arg");
putenv("GATEWAY_INTERFACE=1");
putenv("HTTP_USER_AGENT=${_SERVER['HTTP_USER_AGENT']}");
putenv("ICCULUSFINGER_ALTURL=1");
$io = popen('/webspace/icculus.org/finger/finger.pl', 'r');
if ($io === FALSE) {
header('HTTP/1.0 500 Internal Server Error');
header('Content-Type: text/plain; charset=UTF-8');
print("Internal server error, try again later, please!\n");
exit(0);
}
while (($line = fgets($io)) !== FALSE) {
$line = preg_replace('/[\r\n]*\Z/', '', $line);
if ($line == '')
break;
header($line);
}
fpassthru($io);
pclose($io);
exit(0);
?>