aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/userController.php
diff options
context:
space:
mode:
authorGravatar Clément <clement@selfhost.fr> 2017-02-16 14:27:45 +0100
committerGravatar Clément <clement@selfhost.fr> 2017-02-16 14:27:45 +0100
commit8d2b76334cd60356c85810bf4902124105d54ad4 (patch)
treea303e6f209fd716972ca3421c4b817beec0cabfc /app/Controllers/userController.php
parent08857c679d700b982a1af21ce11c4b25e125e44a (diff)
Possibility to register user having a '-', a '_' or a '.' in username
Diffstat (limited to 'app/Controllers/userController.php')
-rw-r--r--app/Controllers/userController.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index 9d6ae18e6..6199ff218 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -103,8 +103,9 @@ class FreshRSS_user_Controller extends Minz_ActionController {
if (!is_array($userConfig)) {
$userConfig = array();
}
+ $aValid = array('-', '_', '.');
- $ok = ($new_user_name != '') && ctype_alnum($new_user_name);
+ $ok = ($new_user_name != '') && ctype_alnum(str_replace($aValid, '', $new_user_name));
if ($ok) {
$languages = Minz_Translate::availableLanguages();
@@ -187,7 +188,8 @@ class FreshRSS_user_Controller extends Minz_ActionController {
$db = FreshRSS_Context::$system_conf->db;
require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php');
- $ok = ctype_alnum($username);
+ $aValid = array('-', '_', '.');
+ $ok = ctype_alnum(str_replace($aValid, '', $username));
if ($ok) {
$default_user = FreshRSS_Context::$system_conf->default_user;
$ok &= (strcasecmp($username, $default_user) !== 0); //It is forbidden to delete the default user