Skip to content
Browse files
Bugfix: Username ist lost when non-admin user changes profile prefere…

A bug in admin/admin_edit.php creates an empty string for a user's username (and saves that to the database) after the username has been unset because the user is not allowed to change his own username.  The fix prevents this from happening.
  • Loading branch information
bgreiner committed Nov 17, 2015
1 parent a0a4f95 commit a056ecdcaa55dd375687426e00e4ceeba2c4484a
Showing 1 changed file with 3 additions and 2 deletions.
@@ -64,8 +64,8 @@

if ($continue) {
foreach (array('fname','lname','adminname') as $k) $_REQUEST[$k]=trim($_REQUEST[$k]);
if ($continue && isset($_REQUEST['adminname'])) {
$query="SELECT admin_id FROM ".table('admin')."
WHERE adminname = :adminname";
@@ -84,6 +84,7 @@
} else unset($_REQUEST['password']);

if (!$admin_id) $admin_id=time();
foreach (array('fname','lname') as $k) $_REQUEST[$k]=trim($_REQUEST[$k]);

0 comments on commit a056ecd

Please sign in to comment.