Browse Source

Fix an old but harmless glitch in the serialization of inline commands with 0 arguments.

Daniele Alessandri 15 years ago
parent
commit
e70b8ed38b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lib/Predis.php

+ 4 - 1
lib/Predis.php

@@ -421,7 +421,10 @@ abstract class InlineCommand extends Command {
         if (isset($arguments[0]) && is_array($arguments[0])) {
             $arguments[0] = implode($arguments[0], ' ');
         }
-        return $command . ' ' . implode($arguments, ' ') . Protocol::NEWLINE;
+        return $command . (count($arguments) > 0
+            ? ' ' . implode($arguments, ' ') . Protocol::NEWLINE 
+            : Protocol::NEWLINE
+        );
     }
 }