Skip to content

Commit dc76833

Browse files
author
okarpenko
committed
Merge commit 'refs/pull/1389/head' of https://github.com/magento/magento2 into MAGETWO-39123-new
Conflicts: app/code/Magento/Customer/Model/Customer/Attribute/Backend/Password.php
2 parents 140595d + bc1b1e9 commit dc76833

File tree

1 file changed

+2
-11
lines changed
  • app/code/Magento/Customer/Model/Customer/Attribute/Backend

1 file changed

+2
-11
lines changed

app/code/Magento/Customer/Model/Customer/Attribute/Backend/Password.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,8 @@ public function beforeSave($object)
5353
);
5454
}
5555

56-
if ($this->string->substr(
57-
$password,
58-
0,
59-
1
60-
) == ' ' || $this->string->substr(
61-
$password,
62-
$length - 1,
63-
1
64-
) == ' '
65-
) {
66-
throw new LocalizedException(__('The password can\'t begin or end with a space.'));
56+
if (trim($password) != $password) {
57+
throw new LocalizedException(__('The password can not begin or end with a space.'));
6758
}
6859

6960
$object->setPasswordHash($object->hashPassword($password));

0 commit comments

Comments
 (0)