Refactor EncryptionGetChannel to remove UUID validation and cast channel_uuid to string

https://github.com/nosial/Socialbox-PHP/issues/22
This commit is contained in:
netkas 2025-03-11 14:57:18 -04:00
parent b0ce6109d7
commit c5d0e185c3
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -26,15 +26,11 @@
{ {
throw new MissingRpcArgumentException('channel_uuid'); throw new MissingRpcArgumentException('channel_uuid');
} }
elseif(!Validator::validateUuid($rpcRequest->getParameter('channel_uuid')))
{
throw new InvalidRpcArgumentException('channel_uuid', 'The given channel uuid is not a valid UUID V4');
}
try try
{ {
$requestingPeer = $request->getPeer(); $requestingPeer = $request->getPeer();
$encryptionChannel = EncryptionChannelManager::getChannel($rpcRequest->getParameter('channel_uuid')); $encryptionChannel = EncryptionChannelManager::getChannel((string)$rpcRequest->getParameter('channel_uuid'));
} }
catch(DatabaseOperationException $e) catch(DatabaseOperationException $e)
{ {