summaryrefslogtreecommitdiff
path: root/public/index.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-07-20 18:34:19 +0200
committerGitHub <noreply@github.com>2017-07-20 18:34:19 +0200
commit37d4edcd9ace5021b6eb02761a9c3865c5607f33 (patch)
tree16c0da4cd2d9c6c10f5d5e02c1b02bd0986636c2 /public/index.php
parent9b3f6f557a127fef16be267c26f8239dc1c22126 (diff)
parentb7ebb05b8e71b391b6b029fceb5a2d00ff27004c (diff)
Merge pull request #328 from MyIgel/master
Changed $_GET, $_POST and $_REQUEST to use the Request object
Diffstat (limited to 'public/index.php')
-rw-r--r--public/index.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/public/index.php b/public/index.php
index 895b4fe0..52f32438 100644
--- a/public/index.php
+++ b/public/index.php
@@ -24,24 +24,22 @@ $page = '';
$title = '';
$content = '';
-if (!isset($_REQUEST['p'])) {
- $_REQUEST['p'] = isset($user) ? 'news' : 'login';
+$page = $request->input('p');
+if (empty($page)) {
+ $page = isset($user) ? 'news' : 'login';
}
if (
- isset($_REQUEST['p'])
- && preg_match('/^\w*$/i', $_REQUEST['p'])
+ preg_match('/^\w*$/i', $page)
&& (
- in_array($_REQUEST['p'], $free_pages)
- || (isset($privileges) && in_array($_REQUEST['p'], $privileges))
+ in_array($page, $free_pages)
+ || (isset($privileges) && in_array($page, $privileges))
)
) {
- $page = $_REQUEST['p'];
-
$title = $page;
if ($page == 'api') {
- error('Api disabled temporily.');
+ error('Api disabled temporarily.');
redirect(page_link_to());
require_once realpath(__DIR__ . '/../includes/controller/api.php');
api_controller();