Преглед изворни кода

Bugfix: the response parser for KEYS raises a E_WARNING when using iterators for multi bulk responses against Redis v2.0.

Daniele Alessandri пре 15 година
родитељ
комит
ce00cb14b9
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/Predis.php

+ 1 - 1
lib/Predis.php

@@ -1497,7 +1497,7 @@ class Keys extends \Predis\InlineCommand {
     public function getCommandId() { return 'KEYS'; }
     public function parseResponse($data) { 
         // TODO: is this behaviour correct?
-        if (is_array($data)) {
+        if (is_array($data) || $data instanceof \Iterator) {
             return $data;
         }
         return strlen($data) > 0 ? explode(' ', $data) : array();