28 lines
607 B
PHP
28 lines
607 B
PHP
<?php require_once '/src/base.php' ?>
|
|
<?php
|
|
|
|
# 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);
|
|
|
|
# show arguments
|
|
var_dump($fediverse_id);
|
|
var_dump($args);
|