-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Security fix! Big thank you to Matthias <http://blog.yumdap.net/> for…
… spotting it! * add static routes (to avoid 'file inclusion vulnerability') * move routing to Router class again, thanks Matthias!
- Loading branch information
1 parent
b835a19
commit 0e8c436
Showing
12 changed files
with
146 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
return array( | ||
|
||
"" => "/admin/actions/subscriptions.action.php", | ||
"subscriptions" => "/admin/actions/subscriptions.action.php", | ||
"config" => "/admin/actions/config.action.php", | ||
"create_newsletter" => "/admin/actions/create_newsletter.action.php", | ||
"send_newsletter" => "/admin/actions/send_newsletter.action.php", | ||
|
||
); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
class Request { | ||
|
||
public static function view() { | ||
|
||
global $Debugout; | ||
|
||
if (isset($_GET["view"])) { | ||
|
||
$view = $_GET["view"]; | ||
|
||
} else { | ||
|
||
$view = ""; | ||
|
||
} | ||
|
||
return $view; | ||
|
||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
class Router { | ||
|
||
protected $routes = array(); | ||
|
||
|
||
|
||
public static function load($file) { | ||
|
||
$Router = new static; | ||
|
||
$Router->routes = include_once(checkout($file)); | ||
|
||
return $Router; | ||
|
||
} | ||
|
||
public function direct($view) { | ||
|
||
global $Debugout, $error; | ||
|
||
if (array_key_exists($view, $this->routes)) { | ||
|
||
$route = $this->routes[$view]; | ||
|
||
$Debugout->add( | ||
"directing known view '" . $view . "' to", | ||
$route | ||
); | ||
|
||
return $route; | ||
|
||
} else { | ||
|
||
$route = $this->routes[""]; | ||
|
||
$error["routing"]["invalid_route"] = $view; | ||
|
||
$Debugout->add( | ||
"directing unknown view '" . $view . "' to error page" | ||
); | ||
|
||
return "/views/error.view.php"; | ||
|
||
} | ||
|
||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
|
||
return array( | ||
|
||
"" => "/views/subscription.form.php", | ||
"enter_subscription" => "/actions/enter_subscription.action.php", | ||
"manage_subscription" => "/actions/manage_subscription.action.php", | ||
"verify_subscription" => "/actions/verify_subscription.action.php", | ||
"verify_unsubscription" => "/action/verify_unsubscription.action.php", | ||
|
||
); | ||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<h1><?php echo gettext("Error") ?></h1> | ||
|
||
<p><?php echo gettext("An error has occured. Most likely the link is broken. Please try again and make sure that you use the complete and correct link."); ?></p> |