Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use max() function for more compact code!
Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 authored and backportbot-nextcloud[bot] committed May 12, 2022
commit 1d58f0362f6f16a96c6fe3d84f78c512fa125b6c
6 changes: 1 addition & 5 deletions lib/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ public function __construct(PasswordPolicyConfig $config,
* @throws HintException
*/
public function generate(): string {
$minLength = $this->config->getMinLength();
if ($minLength < 8) {
// 8 minimum so we don't generate too short passwords
$minLength = 8;
}
$minLength = max($this->config->getMinLength(), 8);
$length = $minLength;

$password = '';
Expand Down