Don't accept hash commands as reverse sort hash commands unless they actually end with '-rev'.

This commit is contained in:
ccd0 2016-10-29 23:01:24 -07:00
parent 1d0d7f3f2c
commit 6a04dae6a0

View File

@ -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()