Skip to content

Commit 974681c

Browse files
SHyx0rmZmichael-grunder
authored andcommitted
ZRANGEBYLEX also allows '-' or '+' as either min or max
1 parent 46ae5ba commit 974681c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

redis_commands.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,12 @@ int redis_zrangebylex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
875875
return FAILURE;
876876
}
877877

878-
/* min and max must start with '(' or '[' */
879-
if(min_len < 1 || max_len < 1 || (min[0] != '(' && min[0] != '[') ||
880-
(max[0] != '(' && max[0] != '['))
878+
/* min and max must start with '(' or '[', or be either '-' or '+' */
879+
if(min_len < 1 || max_len < 1 ||
880+
(min[0] != '(' && min[0] != '[' &&
881+
(min[0] != '-' || min_len > 1) && (min[0] != '+' || min_len > 1)) ||
882+
(max[0] != '(' && max[0] != '[' &&
883+
(max[0] != '-' || max_len > 1) && (max[0] != '+' || max_len > 1)))
881884
{
882885
php_error_docref(0 TSRMLS_CC, E_WARNING,
883886
"min and max arguments must start with '[' or '('");

0 commit comments

Comments
 (0)