summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-25 21:33:33 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-25 21:33:33 -0500
commita1ad561b9801808dbb1cc70b977a0611aaa70413 (patch)
treebb8cf234ed37fc77560194f0059a68ead1f6d015
parent7fd0f93d029b8bd69409256c39bb0ead7929aa3a (diff)
downloadinvidious-a1ad561b9801808dbb1cc70b977a0611aaa70413.tar.gz
invidious-a1ad561b9801808dbb1cc70b977a0611aaa70413.tar.bz2
invidious-a1ad561b9801808dbb1cc70b977a0611aaa70413.zip
Fix /clear_watch_history
-rw-r--r--src/invidious.cr3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index d2b37705..41c1db9c 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -1201,8 +1201,9 @@ get "/clear_watch_history" do |env|
if user
user = user.as(User)
+ sid = env.get("sid").as(String)
- PG_DB.exec("UPDATE users SET watched = '{}' WHERE id = $1", user.id)
+ PG_DB.exec("UPDATE users SET watched = '{}' WHERE $1 = ANY(id)", sid)
end
env.redirect referer