From 6a04dae6a0cbda4b5cbce5999e8e3c5e906bc6eb Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 29 Oct 2016 23:01:24 -0700 Subject: [PATCH] Don't accept hash commands as reverse sort hash commands unless they actually end with '-rev'. --- src/General/Index.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index eb2a529a0..232feba41 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -372,7 +372,7 @@ Index = state.page = 1 else if (sort = Index.hashCommands.sort[command]) state.sort = sort - else if (sort = Index.hashCommands.sort[command.slice(0,-4)]) + else if command.slice(-4) is '-rev' and (sort = Index.hashCommands.sort[command.slice(0,-4)]) state.sort = sort + '-rev' else if /^s=/.test command state.search = decodeURIComponent(command[2..]).replace(/\+/g, ' ').trim()