mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Bugfix: Squash warning in the search redirector
This commit is contained in:
parent
cdee30c286
commit
1b3bc1cee7
1 changed files with 19 additions and 9 deletions
28
core.php
28
core.php
|
@ -1536,15 +1536,8 @@ $env->action = strtolower($_GET["action"]);
|
|||
//////////////////////////////////////
|
||||
///// Extra consistency measures /////
|
||||
//////////////////////////////////////
|
||||
// Redirect to the search page if there isn't a page with the requested name
|
||||
if(!isset($pageindex->{$env->page}) and isset($_GET["search-redirect"]))
|
||||
{
|
||||
http_response_code(307);
|
||||
$url = "?action=search&query=" . rawurlencode($env->page);
|
||||
header("location: $url");
|
||||
exit(page_renderer::render("Non existent page - $settings->sitename", "<p>There isn't a page on $settings->sitename with that name. However, you could <a href='$url'>search for this page name</a> in other pages.</p>
|
||||
<p>Alternatively, you could <a href='?action=edit&page=" . rawurlencode($env->page) . "&create=true'>create this page</a>.</p>"));
|
||||
}
|
||||
|
||||
// CHANGED: The search redirector has now been moved to below the module registration system, as it was causing a warning here
|
||||
|
||||
// Redirect the user to the login page if:
|
||||
// - A login is required to view this wiki
|
||||
|
@ -1774,6 +1767,23 @@ foreach($remote_files as $remote_file_def) {
|
|||
file_put_contents($remote_file_def["local_filename"], fopen($remote_file_def["remote_url"], "rb"));
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
/// Final Consistency Measures ///
|
||||
//////////////////////////////////
|
||||
|
||||
// Redirect to the search page if there isn't a page with the requested name
|
||||
if(!isset($pageindex->{$env->page}) and isset($_GET["search-redirect"]))
|
||||
{
|
||||
http_response_code(307);
|
||||
$url = "?action=search&query=" . rawurlencode($env->page);
|
||||
header("location: $url");
|
||||
exit(page_renderer::render_minimal("Non existent page - $settings->sitename", "<p>There isn't a page on $settings->sitename with that name. However, you could <a href='$url'>search for this page name</a> in other pages.</p>
|
||||
<p>Alternatively, you could <a href='?action=edit&page=" . rawurlencode($env->page) . "&create=true'>create this page</a>.</p>"));
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
|
||||
// Perform the appropriate action
|
||||
$action_name = $env->action;
|
||||
if(isset($actions->$action_name))
|
||||
|
|
Loading…
Reference in a new issue