From 1c48fcd35eb9e0927fa7f968c1cbde0000f00729 Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 11 Mar 2025 19:15:44 -0400 Subject: [PATCH] Refactor ContactManager to add UUID validation for peer UUID input https://github.com/nosial/Socialbox-PHP/issues/34 --- src/Socialbox/Managers/ContactManager.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Socialbox/Managers/ContactManager.php b/src/Socialbox/Managers/ContactManager.php index 281f8a4..2496689 100644 --- a/src/Socialbox/Managers/ContactManager.php +++ b/src/Socialbox/Managers/ContactManager.php @@ -330,6 +330,11 @@ throw new InvalidArgumentException('The limit cannot exceed a value of ' . Configuration::getPoliciesConfiguration()->getGetContactsLimit()); } + if(!Validator::validateUuid($peerUuid)) + { + throw new InvalidArgumentException('The given peer UUID is not a valid UUID V4'); + } + $contacts = []; try