From 6fe9ec9f7662008aa7a0cdb783cf769b9c588b19 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 22 Jun 2019 00:06:08 +0200 Subject: [PATCH] Allow email as admin username (#2421) Fix https://github.com/FreshRSS/FreshRSS/issues/2418 https://github.com/FreshRSS/FreshRSS/pull/2407 --- app/install.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/install.php b/app/install.php index b15cc76ea..e5142628d 100644 --- a/app/install.php +++ b/app/install.php @@ -125,7 +125,9 @@ function saveStep2() { $_SESSION['title'] = $system_default_config->title; $_SESSION['old_entries'] = param('old_entries', $user_default_config->old_entries); $_SESSION['auth_type'] = param('auth_type', 'form'); - $_SESSION['default_user'] = substr(preg_replace('/[^0-9a-zA-Z_]/', '', param('default_user', '')), 0, 38); + if (FreshRSS_user_Controller::checkUsername(param('default_user', ''))) { + $_SESSION['default_user'] = param('default_user', ''); + } $password_plain = param('passwordPlain', false); if ($password_plain !== false && cryptAvailable()) {