jdp/redisent — Issue #13: sprintf issue
Author: pedigree
Created: 2011-11-22 00:11:39+00:00
State: open

Its not so much an issue in your code but if you compile it in HipHop, the sprintf fails if a string starts with \x00

eg

$args[0] = "\x00\x5f";
$args[1] = "\x81\x77\x97\xa1\x8d\x4a\x25\xc1\x83\x71\xa0\x50\x02\xb7";
$name = 'hget';

If you replace the array_map with this, it works

$command = '*' . intval(count($args)) . CRLF. implode(array_map(function($arg) {
return '$' . intval(strlen($arg)) . CRLF . $arg . CRLF;
}, $args)). . CRLF ;