Add UUID validation in channelUuidExists method of EncryptionChannelManager

This commit is contained in:
netkas 2025-03-07 15:40:55 -05:00
parent 78c5a22c15
commit 90756b49a1

View file

@ -30,6 +30,11 @@
*/ */
public static function channelUuidExists(string $channelUuid): bool public static function channelUuidExists(string $channelUuid): bool
{ {
if(!Validator::validateUuid($channelUuid))
{
throw new InvalidArgumentException('Invalid channel UUID V4');
}
try try
{ {
$stmt = Database::getConnection()->prepare('SELECT COUNT(*) FROM encryption_channels WHERE uuid=:uuid'); $stmt = Database::getConnection()->prepare('SELECT COUNT(*) FROM encryption_channels WHERE uuid=:uuid');