mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 17:23:00 +00:00
redirect: fix redirect logic
This commit is contained in:
parent
36e8fe2a17
commit
0f23ce3fd1
2 changed files with 8 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
register_module([
|
register_module([
|
||||||
"name" => "Redirect pages",
|
"name" => "Redirect pages",
|
||||||
"version" => "0.3.1",
|
"version" => "0.3.2",
|
||||||
"author" => "Starbeamrainbowlabs",
|
"author" => "Starbeamrainbowlabs",
|
||||||
"description" => "Adds support for redirect pages. Uses the same syntax that Mediawiki does.",
|
"description" => "Adds support for redirect pages. Uses the same syntax that Mediawiki does.",
|
||||||
"id" => "feature-redirect",
|
"id" => "feature-redirect",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
register_module([
|
register_module([
|
||||||
"name" => "Page viewer",
|
"name" => "Page viewer",
|
||||||
"version" => "0.16.9",
|
"version" => "0.16.10",
|
||||||
"author" => "Starbeamrainbowlabs",
|
"author" => "Starbeamrainbowlabs",
|
||||||
"description" => "Allows you to view pages. You really should include this one.",
|
"description" => "Allows you to view pages. You really should include this one.",
|
||||||
"id" => "page-view",
|
"id" => "page-view",
|
||||||
|
@ -57,14 +57,16 @@ register_module([
|
||||||
|
|
||||||
// Perform a redirect if the requested page is a redirect page
|
// Perform a redirect if the requested page is a redirect page
|
||||||
if(isset($pageindex->$page->redirect) &&
|
if(isset($pageindex->$page->redirect) &&
|
||||||
$pageindex->$page->redirect === true && // If this is a redirect page.....
|
$pageindex->$page->redirect === true) // If this is a redirect page.....
|
||||||
(isset($pageindex->$page->redirect_absolute) &&
|
|
||||||
$pageindex->$page->redirect_absolute == true && // ...and it's absolute....
|
|
||||||
$settings->redirect_absolute_enable === true)) // ...and absolute reedirects are enabled
|
|
||||||
{
|
{
|
||||||
$send_redirect = true;
|
$send_redirect = true;
|
||||||
if(isset($_GET["redirect"]) && $_GET["redirect"] == "no")
|
if(isset($_GET["redirect"]) && $_GET["redirect"] == "no")
|
||||||
$send_redirect = false;
|
$send_redirect = false;
|
||||||
|
if((isset($pageindex->$page->redirect_absolute) &&
|
||||||
|
$pageindex->$page->redirect_absolute == true && // ...and it's absolute....
|
||||||
|
$settings->redirect_absolute_enable === false)) // ...and absolute reedirects are enabled
|
||||||
|
$send_redirect = false;
|
||||||
|
|
||||||
|
|
||||||
if($send_redirect) {
|
if($send_redirect) {
|
||||||
// TODO: Send an explanatory page along with the redirect
|
// TODO: Send an explanatory page along with the redirect
|
||||||
|
|
Loading…
Reference in a new issue