Skip to content

Commit

Permalink
Merge pull request cakephp#4918 from glafarge/auth-strlen
Browse files Browse the repository at this point in the history
Add strlen condition to hashing func
  • Loading branch information
markstory authored Apr 23, 2017
2 parents 4cf867c + b969f34 commit f72e5c4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion en/tutorials-and-examples/blog-auth-example/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ entity file and add the following::

protected function _setPassword($password)
{
return (new DefaultPasswordHasher)->hash($password);
if (strlen($password) > 0) {
return (new DefaultPasswordHasher)->hash($password);
}
}

// ...
Expand Down
4 changes: 3 additions & 1 deletion es/tutorials-and-examples/blog-auth-example/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ Crea el archivo **src/Model/Entity/User.php** y agrega las siguientes lineas::

protected function _setPassword($password)
{
return (new DefaultPasswordHasher)->hash($password);
if (strlen($password) > 0) {
return (new DefaultPasswordHasher)->hash($password);
}
}

// ...
Expand Down
4 changes: 3 additions & 1 deletion fr/tutorials-and-examples/blog-auth-example/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ fichier entity dans **src/Model/Entity/User.php** et ajoutons ce qui suit::

protected function _setPassword($password)
{
return (new DefaultPasswordHasher)->hash($password);
if (strlen($password) > 0) {
return (new DefaultPasswordHasher)->hash($password);
}
}

// ...
Expand Down
4 changes: 3 additions & 1 deletion ja/tutorials-and-examples/blog-auth-example/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ CakePHP にバンドルされているコード生成ユーティリティを利

protected function _setPassword($password)
{
return (new DefaultPasswordHasher)->hash($password);
if (strlen($password) > 0) {
return (new DefaultPasswordHasher)->hash($password);
}
}

// ...
Expand Down
4 changes: 3 additions & 1 deletion pt/tutorials-and-examples/blog-auth-example/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ e adicione a seguinte trecho::

protected function _setPassword($password)
{
return (new DefaultPasswordHasher)->hash($password);
if (strlen($password) > 0) {
return (new DefaultPasswordHasher)->hash($password);
}
}

// ...
Expand Down

0 comments on commit f72e5c4

Please sign in to comment.