mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
Fixed not working links from database, introduced in 0.8.10
This commit is contained in:
parent
a338fd967c
commit
1e874c7027
@ -167,7 +167,7 @@ else {
|
||||
}
|
||||
|
||||
// handle ?fbclid=x, etc. (show news page)
|
||||
if (!$found && count($_GET) > 0 && !isset($_REQUEST['subtopic']) && !isset($_REQUEST['p'])) {
|
||||
if (!$found && count($_GET) > 0 && !isset($_REQUEST['subtopic']) && !isset($_REQUEST['p']) && !in_array($_SERVER['QUERY_STRING'], getDatabasePages())) {
|
||||
$_REQUEST['p'] = $_REQUEST['subtopic'] = 'news';
|
||||
$found = true;
|
||||
}
|
||||
|
@ -1255,6 +1255,28 @@ function displayErrorBoxWithBackButton($errors, $action = null) {
|
||||
]);
|
||||
}
|
||||
|
||||
function getDatabasePages($withHidden = false): array
|
||||
{
|
||||
global $db, $logged_access;
|
||||
|
||||
if (!isset($logged_access)) {
|
||||
$logged_access = 1;
|
||||
}
|
||||
|
||||
$pages = $db->query('SELECT `name` FROM ' . TABLE_PREFIX . 'pages WHERE ' . ($withHidden ? '' : '`hidden` != 1 AND ') . '`access` <= ' . $db->quote($logged_access));
|
||||
$ret = [];
|
||||
|
||||
if ($pages->rowCount() < 1) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
foreach($pages->fetchAll() as $page) {
|
||||
$ret[] = $page['name'];
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// validator functions
|
||||
require_once LIBS . 'validator.php';
|
||||
require_once SYSTEM . 'compat/base.php';
|
||||
|
Loading…
x
Reference in New Issue
Block a user