From 65229141f1f9c28794452b22cb8f5fabd8069b40 Mon Sep 17 00:00:00 2001 From: "What.CD" Date: Sun, 29 May 2011 08:00:05 +0000 Subject: [PATCH] Fix bug where invite tree would break because the wrong query id was used Unset because it's re-used later Remove cache lock from ip_bans --- classes/script_start.php | 13 +++---------- sections/forums/thread.php | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/classes/script_start.php b/classes/script_start.php index da6051d3..8f2aeb8b 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -391,16 +391,9 @@ function site_ban_ip($IP) { $IP = ip2unsigned($IP); $IPBans = $Cache->get_value('ip_bans'); if(!is_array($IPBans)) { - //Cache lock! - $Lock = $Cache->get_value('ip_bans_lock'); - if($Lock && substr($_SERVER['REQUEST_URI'], 0, 29) != '/torrents.php?action=download') { - ?>cache_value('ip_bans_lock', '1', 10); - $DB->query("SELECT ID, FromIP, ToIP FROM ip_bans"); - $IPBans = $DB->to_array(0, MYSQLI_NUM); - $Cache->cache_value('ip_bans', $IPBans, 0); - } + $DB->query("SELECT ID, FromIP, ToIP FROM ip_bans"); + $IPBans = $DB->to_array(0, MYSQLI_NUM); + $Cache->cache_value('ip_bans', $IPBans, 0); } foreach($IPBans as $Index => $IPBan) { list($ID, $FromIP, $ToIP) = $IPBan; diff --git a/sections/forums/thread.php b/sections/forums/thread.php index 6e591539..af64426b 100644 --- a/sections/forums/thread.php +++ b/sections/forums/thread.php @@ -41,7 +41,7 @@ $ForumID = $ThreadInfo['ForumID']; // Make sure they're allowed to look at the page -if($Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class'] || (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0)) { +if(!check_forumperm($ForumID)) { error(403); }