1.0.0 Alpha Release #59

Merged
netkas merged 213 commits from v1.0.0_alpha into master 2023-01-29 23:27:58 +00:00
Showing only changes of commit 4f30d343e5 - Show all commits

View file

@ -268,6 +268,8 @@
*/
public static function nameFriendly(string $input): bool
{
if(strlen($input) == 0)
return false;
if (!preg_match('/^[a-zA-Z0-9_]+$/', $input))
return false;
if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $input))
@ -275,4 +277,22 @@
return true;
}
/**
* Validates if the given input is a valid path name
*
* @param string $input
* @return bool
*/
public static function pathName(string $input): bool
{
if(strlen($input) == 0)
return false;
if (!preg_match('/^[a-zA-Z0-9_\-\/]+$/', $input))
return false;
if (!preg_match('/^[a-zA-Z_\-\/][a-zA-Z0-9_\-\/]*$/', $input))
return false;
return true;
}
}