mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-03 04:39:20 +02:00
Allow admin pages included into plugins dir
This commit is contained in:
parent
a0ccbbe8c2
commit
eb4ea48641
@ -19,7 +19,7 @@ $content = '';
|
||||
|
||||
// validate page
|
||||
$page = $_GET['p'] ?? '';
|
||||
if(empty($page) || preg_match("/[^a-zA-Z0-9_\-]/", $page))
|
||||
if(empty($page) || preg_match("/[^a-zA-Z0-9_\-\/.]/", $page))
|
||||
$page = 'dashboard';
|
||||
|
||||
$page = strtolower($page);
|
||||
@ -55,8 +55,13 @@ if(!$logged || !admin()) {
|
||||
// include our page
|
||||
$file = BASE . 'admin/pages/' . $page . '.php';
|
||||
if(!@file_exists($file)) {
|
||||
$page = '404';
|
||||
$file = SYSTEM . 'pages/404.php';
|
||||
if (strpos($page, 'plugins/') !== false) {
|
||||
$file = BASE . $page;
|
||||
}
|
||||
else {
|
||||
$page = '404';
|
||||
$file = SYSTEM . 'pages/404.php';
|
||||
}
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user