Updated package name validator
This commit is contained in:
parent
13df43113a
commit
66cf9f2939
1 changed files with 3 additions and 2 deletions
|
@ -115,18 +115,19 @@
|
||||||
* @param $input
|
* @param $input
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function PackageName($input): bool
|
public static function package($input): bool
|
||||||
{
|
{
|
||||||
if($input == null)
|
if($input == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((bool)preg_match("/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+[0-9a-z_]$/", $input) == false)
|
if((bool)preg_match(RegexPatterns::PackageNameFormat, $input) == false)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue