aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/userController.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2019-06-16 20:10:01 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-06-16 20:10:01 +0200
commit7f1ff77f25f5f14a3c8f3b4c661d150468d34f96 (patch)
tree107dd9299ea5fcb430e9b4976906296e09f35796 /app/Controllers/userController.php
parent037c385947aa46e5f9cc125d0a2679ad6d7e7e7d (diff)
Allow email as username (#2407)
* Allow email as username Before, it was possible to register email as username on cli but not in the interface. This was caused by a bug in the pattern which was not working as expected. If your input was "user@example.com", the PHP verification was catching only "user" and was acting like the whole thing was catched. But on the interface, the catching was unsuccesful. Now, the catching should be working properly. I needed to add "$|^" in the pattern because without, I was catching either the beginning of a string either the last char. This was introduced as a workaround for IE/Edge pattern matching on April 27, 2017. See #1511 for more information. I tested it only on FF. Tests on other browsers wanted. See #2391 * Relax and fix username check Allow @ + - * Remove + for now https://github.com/FreshRSS/FreshRSS/pull/2407#issuecomment-502469137
Diffstat (limited to 'app/Controllers/userController.php')
-rw-r--r--app/Controllers/userController.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index be3787561..6d0fced5b 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -38,7 +38,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
* The username is also used as folder name, file name, and part of SQL table name.
* '_' is a reserved internal username.
*/
- const USERNAME_PATTERN = '[0-9a-zA-Z_][0-9a-zA-Z_.]{1,38}|[0-9a-zA-Z]';
+ const USERNAME_PATTERN = '([0-9a-zA-Z_][0-9a-zA-Z_.@-]{1,38}|[0-9a-zA-Z])';
public static function checkUsername($username) {
return preg_match('/^' . self::USERNAME_PATTERN . '$/', $username) === 1;