mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 22:30:30 -04:00
20 lines
469 B
PHP
20 lines
469 B
PHP
<?
|
|
use function Safe\glob;
|
|
use function Safe\preg_replace;
|
|
use function Safe\sort;
|
|
|
|
// Redirect to the latest version of the manual
|
|
|
|
$currentManual = Manual::GetLatestVersion();
|
|
|
|
$url = HttpInput::Str(GET, 'url') ?? '';
|
|
$url = preg_replace('|^/|ius', '', $url);
|
|
$url = preg_replace('|\.php$|ius', '', $url);
|
|
$url = preg_replace('|/$|ius', '', $url);
|
|
|
|
if($url != ''){
|
|
$url = '/' . $url;
|
|
}
|
|
|
|
http_response_code(302);
|
|
header('Location: /manual/' . $currentManual . $url);
|