Always trim the username before saving changes in the database
Fixes #4742
This commit is contained in:
committed by
Frédéric Guillot
parent
5f3225bddc
commit
bd8bcfbc37
@@ -394,4 +394,13 @@ class UserModelTest extends Base
|
||||
$project = $projectModel->getById(1);
|
||||
$this->assertEquals(0, $project['is_active']);
|
||||
}
|
||||
|
||||
public function testTrimUsername()
|
||||
{
|
||||
$userModel = new UserModel($this->container);
|
||||
$this->assertNotFalse($userModel->create(array('username' => 'test ')));
|
||||
|
||||
$this->assertNotEmpty($userModel->getByUsername('test'));
|
||||
$this->assertEmpty($userModel->getByUsername('test '));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user