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

Changed the way arguments of SLAVEOF are prepared before serialization to be compatible with an eventual switch to multi-bulk requests.

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

+ 4 - 1
lib/Predis.php

@@ -2283,7 +2283,10 @@ class SlaveOf extends \Predis\InlineCommand {
     public function canBeHashed()  { return false; }
     public function getCommandId() { return 'SLAVEOF'; }
     public function filterArguments(Array $arguments) {
-        return count($arguments) === 0 ? array('NO ONE') : $arguments;
+        if (count($arguments) === 0 || $arguments[0] === 'NO ONE') {
+            return array('NO', 'ONE');
+        }
+        return $arguments;
     }
 }