Merge pull request #6509 from mrhappyma/patch-1

remove ~ from forbidden characters in git URLs
This commit is contained in:
Andras Bacsai
2025-09-22 12:45:13 +02:00
committed by GitHub

View File

@@ -31,7 +31,7 @@ class ValidGitRepositoryUrl implements ValidationRule
$dangerousChars = [ $dangerousChars = [
';', '|', '&', '$', '`', '(', ')', '{', '}', ';', '|', '&', '$', '`', '(', ')', '{', '}',
'[', ']', '<', '>', '\n', '\r', '\0', '"', "'", '[', ']', '<', '>', '\n', '\r', '\0', '"', "'",
'\\', '!', '?', '*', '~', '^', '%', '=', '+', '\\', '!', '?', '*', '^', '%', '=', '+',
'#', // Comment character that could hide commands '#', // Comment character that could hide commands
]; ];
@@ -85,7 +85,7 @@ class ValidGitRepositoryUrl implements ValidationRule
} }
// Validate SSH URL format (git@host:user/repo.git) // Validate SSH URL format (git@host:user/repo.git)
if (! preg_match('/^git@[a-zA-Z0-9\.\-]+:[a-zA-Z0-9\-_\/\.]+$/', $value)) { if (! preg_match('/^git@[a-zA-Z0-9\.\-]+:[a-zA-Z0-9\-_\/\.~]+$/', $value)) {
$fail('The :attribute is not a valid SSH repository URL.'); $fail('The :attribute is not a valid SSH repository URL.');
return; return;