Skip to content

Commit ed5b755

Browse files
committed
Fixes potential for generated password to not meet own validation requirements
1 parent 90460be commit ed5b755

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1212
* File uploads now account for a maximum file size that is assigned for the daemon, and gives cleaner errors when that limit is reached.
1313
* File upload limit can now be controlled from the panel.
1414

15+
### Fixed
16+
* Fixes potential for generated password to not meet own validation requirements.
17+
1518
## v0.5.3 (Bodacious Boreopterus)
1619
### Fixed
1720
* Fixed an error that occurred when viewing a node listing when no nodes were created yet due to a mis-declared variable. Also fixes a bug that would have all nodes trying to connect to the daemon using the same secret token on the node listing, causing only the last node to display properly.

app/Http/Controllers/Base/IndexController.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,16 @@ public function getIndex(Request $request)
6262
public function getPassword(Request $request, $length = 16)
6363
{
6464
$length = ($length < 8) ? 8 : $length;
65-
return str_random($length);
65+
66+
$returnable = false;
67+
while (!$returnable) {
68+
$generated = str_random($length);
69+
if (preg_match('/[A-Z]+[a-z]+[0-9]+/', $generated)) {
70+
$returnable = true;
71+
}
72+
}
73+
74+
return $generated;
6675
}
6776

6877
}

0 commit comments

Comments
 (0)