Skip to content

Commit

Permalink
Bugfix: user with uppercase letters in its username broke the Groups …
Browse files Browse the repository at this point in the history
…page

Fixes thibaud-rohmer#276
  • Loading branch information
gboudreau committed Feb 11, 2017
1 parent b28b71a commit 56b6a1e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/classes/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,11 @@ public static function edit($login=NULL, $old_password=NULL, $password=NULL, $na
return;
}

if(isset($login) && (preg_match("/^[A-Z][a-zA-Z -]+$/", $login) === 0) ){
$acc = new Account($login);
if(isset($login)){
$acc = new Account($login);
if(!$acc){
throw new Exception("Error: user with username '$login' not found.");
}
}else{
$acc = CurrentUser::$account;
}
Expand Down

0 comments on commit 56b6a1e

Please sign in to comment.