diff --git a/modules/page-view.php b/modules/page-view.php index 23130bf..a8f02a4 100644 --- a/modules/page-view.php +++ b/modules/page-view.php @@ -28,6 +28,21 @@ register_module([ exit(page_renderer::render_main("$env->page - 404 - $settings->sitename", "

$env->page does not exist.

Since editing is currently disabled on this wiki, you may not create this page. If you feel that this page should exist, try contacting this wiki's Administrator.

")); } } + + // Perform a redirect if the requested page is a redirect page + if(isset($pageindex->$page->redirect) && + $pageindex->$page->redirect === true && + ( // Make sure that the redirect GET paramter isn'tset to 'no' + isset($_GET["redirect"]) && + $_GET["redirect"] !== "no" + )) + { + // Todo send an explanatory page along with the redirect + http_response_code(307); + header("location: ?action=view&page=" . $pageindex->$page->redirect_target . "&redirected_from=$env->page"); + exit(); + } + $title = "$env->page - $settings->sitename"; if(isset($pageindex->$page->protect) && $pageindex->$page->protect === true) $title = $settings->protectedpagechar . $title;