2021-11-25 12:26:50 +00:00
|
|
|
<?php require_once '/src/base.php' ?>
|
|
|
|
<?php
|
|
|
|
|
2021-11-25 12:54:55 +00:00
|
|
|
if (!isset($_SERVER['REDIRECT_URL'])) {
|
|
|
|
header('Location: /'); die;
|
|
|
|
}
|
|
|
|
|
2021-11-25 12:26:50 +00:00
|
|
|
# process URI
|
|
|
|
$path = trim($_SERVER['REDIRECT_URL'], '/');
|
|
|
|
$args = explode('/', $path);
|
|
|
|
|
|
|
|
# no args is very unlikely, but still
|
|
|
|
if (count($args) === 0) {
|
|
|
|
die('Unexpected error');
|
|
|
|
}
|
|
|
|
|
|
|
|
# support path if /user/@* instead of /@*
|
|
|
|
if (strtolower($args[0]) === 'user') {
|
|
|
|
$args = array_splice($args, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# first arg => Fediverse ID
|
|
|
|
$fediverse_id = $args[0];
|
|
|
|
if (!preg_match('/^@[a-zA-Z0-9_]+@[a-z0-9\-\.]+$/', $fediverse_id)) {
|
|
|
|
die('The given arguments are not correct');
|
|
|
|
}
|
|
|
|
$args = array_splice($args, 1);
|
|
|
|
|
2021-11-25 12:54:55 +00:00
|
|
|
?>
|
|
|
|
<?php require '/src/views/head.php' ?>
|
|
|
|
<?php require '/src/views/public/head.php' ?>
|
|
|
|
<main>
|
|
|
|
USER: <?php echo $fediverse_id ?>
|
|
|
|
</main>
|
|
|
|
<?php require '/src/views/public/foot.php' ?>
|
|
|
|
<?php require '/src/views/foot.php' ?>
|