mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-20 02:11:52 -04:00
Missing checkUsername and const patten
https://github.com/FreshRSS/FreshRSS/pull/1423 https://github.com/YunoHost-Apps/freshrss_ynh/issues/27#issuecomment-279792363
This commit is contained in:
1 parent
2e871a0adf
commit
271a1fdc89
11 files changed
+17
-12
No files matched your search
@@ -34,9 +34,14 @@ class FreshRSS_user_Controller extends Minz_ActionController {
|
||||
return $passwordHash == '' ? '' : $passwordHash;
|
||||
}
|
||||
|
||||
/**
|
||||
* The username is also used as folder name, and part of SQL table name.
|
||||
* '_' is a reserved internal username.
|
||||
*/
|
||||
const USERNAME_PATTERN = '[0-9a-zA-Z]|[0-9a-zA-Z_]{2,38}';
|
||||
|
||||
public static function checkUsername($username) {
|
||||
$match = '/^[0-9a-zA-Z_]{1,38}$/';
|
||||
return preg_match($match, $username) === 1;
|
||||
return preg_match('/^' . self::USERNAME_PATTERN . '$/', $username) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user