mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-23 01:55:01 +00:00
Get search redirector to check ucwords(pagename) too - fixes #160
This commit is contained in:
parent
0e3104415a
commit
cd2497cea4
3 changed files with 16 additions and 1 deletions
|
@ -16,6 +16,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
|
|||
- [Module API] Fix `full_url()` logic
|
||||
- [Module API] Make `email_user()` correctly return email sending failures
|
||||
- Squashed a warning in the search redirector
|
||||
- The search redirector will now check both the specified page name and the page name in Title Case
|
||||
|
||||
## Changed
|
||||
- Password hashing has been overhauled! A totally new-and-different system is being used now, so you'll need to rehash all your passwords.
|
||||
|
|
|
@ -402,7 +402,7 @@ if($settings->sessionprefix == "auto")
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
/** The version of Pepperminty Wiki currently running. */
|
||||
$version = "v0.17-dev";
|
||||
$commit = "31d555f482dc6cf0416907f3ea1b11875765ccc7";
|
||||
$commit = "0e3104415acdf339000212466bc7e978d48e3d50";
|
||||
/// Environment ///
|
||||
/** Holds information about the current request environment. */
|
||||
$env = new stdClass();
|
||||
|
@ -9230,6 +9230,13 @@ foreach($remote_files as $remote_file_def) {
|
|||
/// Final Consistency Measures ///
|
||||
//////////////////////////////////
|
||||
|
||||
if(!isset($pageindex->{$env->page}) && isset($pageindex->{ucwords($env->page)})) {
|
||||
http_response_code(307);
|
||||
header("location: ?page=" . ucwords($env->page));
|
||||
header("content-type: text/plain");
|
||||
exit("$env->page doesn't exist on $settings->sitename, but " . ucwords($env->page) . " does. You should be redirected there automatically.");
|
||||
}
|
||||
|
||||
// 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"]))
|
||||
{
|
||||
|
|
7
core.php
7
core.php
|
@ -1771,6 +1771,13 @@ foreach($remote_files as $remote_file_def) {
|
|||
/// Final Consistency Measures ///
|
||||
//////////////////////////////////
|
||||
|
||||
if(!isset($pageindex->{$env->page}) && isset($pageindex->{ucwords($env->page)})) {
|
||||
http_response_code(307);
|
||||
header("location: ?page=" . ucwords($env->page));
|
||||
header("content-type: text/plain");
|
||||
exit("$env->page doesn't exist on $settings->sitename, but " . ucwords($env->page) . " does. You should be redirected there automatically.");
|
||||
}
|
||||
|
||||
// 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"]))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue