Refactor ContactManager to add validation for peer address and UUID input
https://github.com/nosial/Socialbox-PHP/issues/31
This commit is contained in:
parent
0bc51a9917
commit
86050e2201
1 changed files with 9 additions and 0 deletions
|
@ -191,6 +191,15 @@
|
||||||
{
|
{
|
||||||
$contactAddress = $contactAddress->getAddress();
|
$contactAddress = $contactAddress->getAddress();
|
||||||
}
|
}
|
||||||
|
elseif(!Validator::validatePeerAddress($contactAddress))
|
||||||
|
{
|
||||||
|
throw new InvalidArgumentException('The given contact address is invalid');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Validator::validateUuid($peerUuid))
|
||||||
|
{
|
||||||
|
throw new InvalidArgumentException('The given internal peer UUID is not a valid UUID V4');
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue