feat(validation): enhance ValidGitRepositoryUrl to support additional safe characters and add comprehensive unit tests for various Git repository URL formats

This commit is contained in:
Andras Bacsai
2025-09-28 22:18:21 +02:00
parent e5f13fb363
commit 810ba3dd9e
2 changed files with 357 additions and 1 deletions

View File

@@ -136,7 +136,7 @@ class ValidGitRepositoryUrl implements ValidationRule
// Validate path contains only safe characters
$path = $parsed['path'] ?? '';
if (! empty($path) && ! preg_match('/^[a-zA-Z0-9\-_\/\.]+$/', $path)) {
if (! empty($path) && ! preg_match('/^[a-zA-Z0-9\-_\/\.@~]+$/', $path)) {
$fail('The :attribute path contains invalid characters.');
return;