mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Fixed auth(): empty $f_access (#1329)
* Fixed auth(): empty $f_access * Update functions.php * Update CHANGELOG.md * Updated * Update functions.php * Update functions.php
This commit is contained in:
parent
7ee71887f2
commit
3b4fe8008b
5 changed files with 13 additions and 6 deletions
|
@ -270,6 +270,9 @@ function auth($type, $forum_id, $ug_data, array $f_access = [], $group_perm = UG
|
|||
$add_auth_type_desc = ($forum_id != AUTH_LIST_ALL);
|
||||
|
||||
// Check forum existence
|
||||
if (!forum_exists()) {
|
||||
return [];
|
||||
}
|
||||
if ($add_auth_type_desc && !forum_exists($forum_id)) {
|
||||
return [];
|
||||
}
|
||||
|
@ -1829,8 +1832,12 @@ function get_topic_title($topic_id)
|
|||
return $row['topic_title'];
|
||||
}
|
||||
|
||||
function forum_exists($forum_id): bool
|
||||
function forum_exists($forum_id = null): bool
|
||||
{
|
||||
if (!isset($forum_id)) {
|
||||
return (bool)DB()->fetch_row("SELECT * FROM " . BB_FORUMS . " LIMIT 1");
|
||||
}
|
||||
|
||||
return (bool)DB()->fetch_row("SELECT forum_id FROM " . BB_FORUMS . " WHERE forum_id = $forum_id LIMIT 1");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue