mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
small fixes
This commit is contained in:
parent
d565b90736
commit
590fe0762d
@ -55,10 +55,9 @@ if (BASE_DIR !== '') {
|
|||||||
|
|
||||||
define('URI', $uri);
|
define('URI', $uri);
|
||||||
|
|
||||||
/** @var boolean $load_it */
|
|
||||||
if(!$load_it) {
|
if(!$load_it) {
|
||||||
// ignore warnings in some functions/plugins
|
// ignore warnings in some functions/plugins
|
||||||
// page is not loaded anyways
|
// page is not loaded anyway
|
||||||
define('PAGE', '');
|
define('PAGE', '');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -147,6 +146,10 @@ $found = true;
|
|||||||
// old support for pages like /?subtopic=accountmanagement
|
// old support for pages like /?subtopic=accountmanagement
|
||||||
$page = $_REQUEST['p'] ?? ($_REQUEST['subtopic'] ?? '');
|
$page = $_REQUEST['p'] ?? ($_REQUEST['subtopic'] ?? '');
|
||||||
if(!empty($page) && preg_match('/^[A-z0-9\-]+$/', $page)) {
|
if(!empty($page) && preg_match('/^[A-z0-9\-]+$/', $page)) {
|
||||||
|
if (isset($_REQUEST['p'])) { // some plugins may require this
|
||||||
|
$_REQUEST['subtopic'] = $_REQUEST['p'];
|
||||||
|
}
|
||||||
|
|
||||||
if (config('backward_support')) {
|
if (config('backward_support')) {
|
||||||
require SYSTEM . 'compat/pages.php';
|
require SYSTEM . 'compat/pages.php';
|
||||||
}
|
}
|
||||||
@ -161,7 +164,6 @@ else {
|
|||||||
switch ($routeInfo[0]) {
|
switch ($routeInfo[0]) {
|
||||||
case FastRoute\Dispatcher::NOT_FOUND:
|
case FastRoute\Dispatcher::NOT_FOUND:
|
||||||
// ... 404 Not Found
|
// ... 404 Not Found
|
||||||
//var_dump('not found');
|
|
||||||
/**
|
/**
|
||||||
* Fallback to load page from templates/ or system/pages/ directory
|
* Fallback to load page from templates/ or system/pages/ directory
|
||||||
*/
|
*/
|
||||||
@ -282,7 +284,8 @@ function getDatabasePages() {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadPageFromFileSystem($page, &$found) {
|
function loadPageFromFileSystem($page, &$found): string
|
||||||
|
{
|
||||||
$file = SYSTEM . 'pages/' . $page . '.php';
|
$file = SYSTEM . 'pages/' . $page . '.php';
|
||||||
if (!is_file($file)) {
|
if (!is_file($file)) {
|
||||||
// feature: convert camelCase to snake_case
|
// feature: convert camelCase to snake_case
|
||||||
|
@ -27,7 +27,7 @@ if(isset($config['boxes']))
|
|||||||
var loginStatus="<?php echo ($logged ? 'true' : 'false'); ?>";
|
var loginStatus="<?php echo ($logged ? 'true' : 'false'); ?>";
|
||||||
<?php
|
<?php
|
||||||
if(PAGE !== 'news') {
|
if(PAGE !== 'news') {
|
||||||
if(strpos(URI, 'subtopic=') !== false) {
|
if(isset($_REQUEST['subtopic'])) {
|
||||||
$tmp = $_REQUEST['subtopic'];
|
$tmp = $_REQUEST['subtopic'];
|
||||||
if($tmp === 'accountmanagement') {
|
if($tmp === 'accountmanagement') {
|
||||||
$tmp = 'accountmanage';
|
$tmp = 'accountmanage';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user