mirror of
https://github.com/predis/predis.git
synced 2026-09-13 20:07:28 +00:00
Deprecate unsafe API
This commit is contained in:
@@ -158,6 +158,9 @@ abstract class Command implements CommandInterface
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Not binary-safe; see CommandInterface::deserializeCommand().
|
||||
* Scheduled for removal in the next major.
|
||||
*/
|
||||
public static function deserializeCommand(string $serializedCommand): CommandInterface
|
||||
{
|
||||
|
||||
@@ -98,6 +98,12 @@ interface CommandInterface
|
||||
*
|
||||
* @param string $serializedCommand
|
||||
* @return static
|
||||
*
|
||||
* @deprecated Not binary-safe: it re-parses on "\r\n" and ignores RESP bulk-length
|
||||
* prefixes, so any argument containing "\r\n" is corrupted, and it
|
||||
* instantiates a command class from the parsed input. Never call it on
|
||||
* untrusted or serialized data (see CVE GHSA-w6f5-v2h6-g786). Scheduled
|
||||
* for removal in the next major.
|
||||
*/
|
||||
public static function deserializeCommand(string $serializedCommand): CommandInterface;
|
||||
}
|
||||
|
||||
@@ -153,6 +153,12 @@ final class RawCommand implements CommandInterface
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @deprecated Not binary-safe; see CommandInterface::deserializeCommand().
|
||||
* Scheduled for removal in the next major.
|
||||
*/
|
||||
public static function deserializeCommand(string $serializedCommand): CommandInterface
|
||||
{
|
||||
if ($serializedCommand[0] !== '*') {
|
||||
|
||||
Reference in New Issue
Block a user