25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Fix webadmin muc room sorting broken due to trailing slash patch (#3256)

This commit is contained in:
Badlop 2020-05-07 10:34:28 +02:00
parent 51e45516a4
commit e5a2d42484

View File

@ -495,7 +495,8 @@ get_sort_query(Q) ->
get_sort_query2(Q) ->
{value, {_, String}} = lists:keysearch(<<"sort">>, 1, Q),
Integer = binary_to_integer(String),
{StringClean, _} = string:take(String, [$/], true),
Integer = binary_to_integer(StringClean),
case Integer >= 0 of
true -> {ok, {normal, Integer}};
false -> {ok, {reverse, abs(Integer)}}