From e70b8ed38bf15a6b09bafb7963ed99cc0b60fc6b Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Fri, 21 May 2010 21:10:34 +0200 Subject: [PATCH] Fix an old but harmless glitch in the serialization of inline commands with 0 arguments. --- lib/Predis.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Predis.php b/lib/Predis.php index 2e5d88a3..c60a8fac 100644 --- a/lib/Predis.php +++ b/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 + ); } }