Skip to content

Commit 8bfa218

Browse files
SHyx0rmZmichael-grunder
authored andcommitted
ZRANGEBYLEX also allows '-' or '+' as either min or max
1 parent b295ff3 commit 8bfa218

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
@@ -880,9 +880,12 @@ int redis_zrangebylex_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
880880
return FAILURE;
881881
}
882882

883-
/* min and max must start with '(' or '[' */
884-
if(min_len < 1 || max_len < 1 || (min[0] != '(' && min[0] != '[') ||
885-
(max[0] != '(' && max[0] != '['))
883+
/* min and max must start with '(' or '[', or be either '-' or '+' */
884+
if(min_len < 1 || max_len < 1 ||
885+
(min[0] != '(' && min[0] != '[' &&
886+
(min[0] != '-' || min_len > 1) && (min[0] != '+' || min_len > 1)) ||
887+
(max[0] != '(' && max[0] != '[' &&
888+
(max[0] != '-' || max_len > 1) && (max[0] != '+' || max_len > 1)))
886889
{
887890
php_error_docref(0 TSRMLS_CC, E_WARNING,
888891
"min and max arguments must start with '[' or '('");

0 commit comments

Comments
 (0)