Removed verify_id() function (#1187)

This commit is contained in:
Roman Kelesidis 2023-12-04 21:13:36 +07:00 committed by GitHub
commit e49005b1a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 14 deletions

View file

@ -253,11 +253,6 @@ function mkdir_rec($path, $mode): bool
return mkdir_rec(dirname($path), $mode) && mkdir($path, $mode);
}
function verify_id($id, $length): bool
{
return (is_string($id) && preg_match('#^[a-zA-Z0-9]{' . $length . '}$#', $id));
}
function clean_filename($fname)
{
static $s = ['\\', '/', ':', '*', '?', '"', '<', '>', '|', ' '];
@ -292,10 +287,10 @@ function str_compact($str)
*
* Should not be considered sufficient for cryptography, etc.
*
* @param int|string $length
* @param int $length
* @return string
*/
function make_rand_str($length = 10): string
function make_rand_str(int $length = 10): string
{
$pool = str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');