From 203ac5476fb561cbf2b67bf0dda1366683b706b0 Mon Sep 17 00:00:00 2001 From: MordredKLB Date: Fri, 25 Mar 2016 16:36:23 -0500 Subject: [PATCH] action=user_recents did not respect paranoia settings --- sections/ajax/user_recents.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sections/ajax/user_recents.php b/sections/ajax/user_recents.php index fc22b979..ae395f87 100644 --- a/sections/ajax/user_recents.php +++ b/sections/ajax/user_recents.php @@ -8,6 +8,26 @@ if (empty($Limit)) { $Limit = 15; } + +if ($UserID != $LoggedUser['ID']) { + // We can always view our own torrents + $DB->query(" + SELECT m.Paranoia + FROM users_main AS m + WHERE m.ID = $UserID"); + + if (!$DB->has_results()) { // If user doesn't exist + json_die("failure", "no such user"); + } + + list($Paranoia) = $DB->next_record(MYSQLI_NUM, false); + + $Paranoia = unserialize($Paranoia); + if (!is_array($Paranoia)) { + $Paranoia = array(); + } +} + $Results = array(); if (check_paranoia_here('snatched')) { $DB->query("