1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-26 02:52:30 +01:00

Fixed RegEx validate database password (#1667)

This commit is contained in:
Oreo Oreoniv 2019-08-05 20:02:31 +03:00 committed by Dane Everitt
parent d430acf768
commit 917e5e19aa

View File

@ -60,7 +60,7 @@ class DatabasePasswordServiceTest extends TestCase
$this->dynamic->shouldReceive('set')->with('dynamic', $model->database_host_id)->once()->andReturnNull(); $this->dynamic->shouldReceive('set')->with('dynamic', $model->database_host_id)->once()->andReturnNull();
$this->encrypter->expects('encrypt')->with(m::on(function ($string) { $this->encrypter->expects('encrypt')->with(m::on(function ($string) {
preg_match_all('/[!@+=^-]/', $string, $matches, PREG_SET_ORDER); preg_match_all('/[!@+=.^-]/', $string, $matches, PREG_SET_ORDER);
$this->assertTrue(count($matches) >= 2 && count($matches) <= 6, "Failed asserting that [{$string}] contains 2 to 6 special characters."); $this->assertTrue(count($matches) >= 2 && count($matches) <= 6, "Failed asserting that [{$string}] contains 2 to 6 special characters.");
$this->assertTrue(strlen($string) === 24, "Failed asserting that [{$string}] is 24 characters in length."); $this->assertTrue(strlen($string) === 24, "Failed asserting that [{$string}] is 24 characters in length.");