Refactor AddressBookRevokeSignature and ContactManager to remove UUID validation and improve error handling

https://github.com/nosial/Socialbox-PHP/issues/36
This commit is contained in:
netkas 2025-03-11 15:26:22 -04:00
parent 50c638b534
commit eadf1cd3a4
Signed by: netkas
GPG key ID: 4D8629441B76E4CC
2 changed files with 12 additions and 12 deletions

View file

@ -7,6 +7,7 @@
use ncc\ThirdParty\Symfony\Uid\UuidV4;
use PDO;
use PDOException;
use Socialbox\Classes\Cryptography;
use Socialbox\Classes\Database;
use Socialbox\Classes\Validator;
use Socialbox\Enums\Types\ContactRelationshipType;
@ -424,6 +425,15 @@
{
$contactUuid = $contactUuid->getUuid();
}
elseif(!Validator::validateUuid($contactUuid))
{
throw new InvalidArgumentException('The given contact UUID is not a valid UUID V4');
}
if(!Validator::validateUuid($signatureUuid))
{
throw new InvalidArgumentException('The given signature UUID is not a valid UUID V4');
}
try
{