Skip to content

Commit 0ba6e32

Browse files
committed
Bugfix for multi-bulk empty list reply.
1 parent 4505159 commit 0ba6e32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function _reply($fp)
6565
$reply_type = $reply[0];
6666
$data = substr($reply, 1);
6767

68-
switch($reply[0])
68+
switch($reply_type)
6969
{
7070
case STATUS_REPLY:
7171
if ('ok' == strtolower($data)) return true;
@@ -88,7 +88,7 @@ function _reply($fp)
8888
$bulk_reply_count = intval($data);
8989
if ($bulk_reply_count < 0) return NULL;
9090
$multi_bulk_reply = array();
91-
foreach(range(1, $bulk_reply_count) as $i) $multi_bulk_reply[] = _reply($fp);
91+
for($i = 0; $i < $bulk_reply_count; $i++) $multi_bulk_reply[] = _reply($fp);
9292
return $multi_bulk_reply;
9393

9494
default:

0 commit comments

Comments
 (0)