From 7df1bb5f786191fb3f37b0a5867dc603c4e68c17 Mon Sep 17 00:00:00 2001 From: gabriel-BW <96146559+gabriel-BW@users.noreply.github.com> Date: Sun, 13 Apr 2025 17:29:18 +0200 Subject: [PATCH 1/3] Update CommentModel.php Using 9 digits instead of 8 to recognize a phone number, because I realized 8 can match a date (yyyy-mm-dd). Most countries have more than 9-digit numbers. --- src/Model/CommentModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/CommentModel.php b/src/Model/CommentModel.php index 044220b8b..d2f669d1b 100644 --- a/src/Model/CommentModel.php +++ b/src/Model/CommentModel.php @@ -179,7 +179,7 @@ public function checkForEmailAddress(Comment $comment): bool public function checkForPhoneNumber(Comment $comment): bool { $commentText = $comment->getTextfree(); - $found = preg_match("/([0-9][\. \)-]*){8,}/", $commentText); + $found = preg_match("/([0-9][\. \)-]*){9,}/", $commentText); return $found > 0; } From 6aa4ab095c18d9de4b5347ce62299b1df493bc5d Mon Sep 17 00:00:00 2001 From: gabriel-BW <96146559+gabriel-BW@users.noreply.github.com> Date: Sun, 13 Apr 2025 17:32:48 +0200 Subject: [PATCH 2/3] Update RelationController.php Using 9 digits instead of 8 to recognize a phone number, because I realized 8 can match a date (yyyy-mm-dd). Most countries have more than 9-digit numbers. --- src/Controller/RelationController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/RelationController.php b/src/Controller/RelationController.php index 5de69f614..fd23a2b0c 100644 --- a/src/Controller/RelationController.php +++ b/src/Controller/RelationController.php @@ -238,7 +238,7 @@ private function checkForEmailAddress(Relation $relation): bool private function checkForPhoneNumber(Relation $relation): bool { $relationText = $relation->getCommentText(); - $found = preg_match("/([0-9][\. \)-]*){8,}/", $relationText); + $found = preg_match("/([0-9][\. \)-]*){9,}/", $relationText); return $found > 0; } From 4671464deab120961a42038cf45c1b1dfcec299d Mon Sep 17 00:00:00 2001 From: gabriel-BW <96146559+gabriel-BW@users.noreply.github.com> Date: Sun, 13 Apr 2025 17:34:53 +0200 Subject: [PATCH 3/3] Update preferences.yml Setting the default value to not accepting contacts from empty profiles (as discussed in BeVolunteer) --- fixtures/preferences.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fixtures/preferences.yml b/fixtures/preferences.yml index b08140266..57d9703d0 100644 --- a/fixtures/preferences.yml +++ b/fixtures/preferences.yml @@ -203,7 +203,7 @@ App\Entity\Preference: codeDescription: 'contact.allow.no.picture' description: 'Allow to be contacted by members without a picture' created: - DefaultValue: Yes + DefaultValue: No PossibleValues: No,Yes ALLOW_REQUEST_NO_ABOUT_ME: position: 64 @@ -211,5 +211,5 @@ App\Entity\Preference: codeDescription: 'contact.allow.no.about_me' description: 'Allow to be contacted by members without an about me section' created: - DefaultValue: Yes + DefaultValue: No PossibleValues: No,Yes