mirror of
https://github.com/standardebooks/web.git
synced 2025-07-23 07:44:49 -04:00
Add warnings pointing to latest manual version on all old manual pages
This commit is contained in:
parent
e56c6b4642
commit
8deafc7543
4 changed files with 36 additions and 5 deletions
|
@ -6,10 +6,7 @@ use function Safe\sort;
|
|||
|
||||
// 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]);
|
||||
$currentManual = Manual::GetLatestVersion();
|
||||
|
||||
$url = HttpInput::GetString('url', true, '');
|
||||
$url = preg_replace('|^/|ius', '', $url);
|
||||
|
@ -21,4 +18,4 @@ if($url != ''){
|
|||
}
|
||||
|
||||
http_response_code(302);
|
||||
header('Location: ' . $currentManual . $url);
|
||||
header('Location: /manual/' . $currentManual . $url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue