mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 14:20:29 -04:00
21 lines
499 B
PHP
21 lines
499 B
PHP
<?
|
|
require_once('Core.php');
|
|
|
|
// Redirect to the latest version of the manual
|
|
|
|
$dirs = glob(MANUAL_PATH . '/*', GLOB_ONLYDIR);
|
|
sort($dirs);
|
|
|
|
$currentManual = str_replace(WEB_ROOT, '', $dirs[sizeof($dirs) - 1]);
|
|
|
|
$url = HttpInput::GetString('url', true, '');
|
|
$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: ' . $currentManual . $url);
|