22 lines
543 B
PHP
22 lines
543 B
PHP
<?php
|
|
if (isset($_GET['l'])) {
|
|
$l = $_GET['l'];
|
|
if (strpos($l, '/') !== false || strpos($l, '~') !== false || strpos($l, '.') !== false) {
|
|
http_response_code(400);
|
|
echo "hehe no you don't";
|
|
die;
|
|
}
|
|
$path = 'links/'.$l;
|
|
if (file_exists($path)) {
|
|
$target = file_get_contents($path);
|
|
header('Location: ' . $target);
|
|
} else {
|
|
http_response_code(404);
|
|
echo "<h1>not found</h1>";
|
|
echo 'nyy-a?';
|
|
}
|
|
} else {
|
|
echo "<h1>nyaaaa!</h1>";
|
|
echo "~w~\n";
|
|
}
|
|
?>
|