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 a3c3322f28 - Show all commits

View file

@ -258,4 +258,21 @@
return false; return false;
} }
/**
* Determines if the input is considered "name friendly" and does not
* contain any special characters, spaces or weird prefixes
*
* @param string $input
* @return bool
*/
public static function nameFriendly(string $input): bool
{
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;
}
} }