Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit210e9e4

Browse files
committed
skip test assertions that are no longer valid with PHP >= 8.2.18/8.3.5
1 parenta0deee5 commit210e9e4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

‎src/Symfony/Component/PasswordHasher/Tests/Hasher/NativePasswordHasherTest.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ public function testBcryptWithNulByte()
103103
$hasher =newNativePasswordHasher(null,null,4, \PASSWORD_BCRYPT);
104104
$plainPassword ="a\0b";
105105

106-
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' =>4]),$plainPassword));
106+
if (\PHP_VERSION_ID <80218 || \PHP_VERSION_ID >=80300 && \PHP_VERSION_ID <80305) {
107+
// password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5
108+
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' =>4]),$plainPassword));
109+
}
110+
107111
$this->assertTrue($hasher->verify($hasher->hash($plainPassword),$plainPassword));
108112
}
109113

‎src/Symfony/Component/PasswordHasher/Tests/Hasher/SodiumPasswordHasherTest.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public function testBcryptWithNulByte()
7878
$hasher =newSodiumPasswordHasher(null,null);
7979
$plainPassword ="a\0b";
8080

81-
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' =>4]),$plainPassword));
81+
if (\PHP_VERSION_ID <80218 || \PHP_VERSION_ID >=80300 && \PHP_VERSION_ID <80305) {
82+
// password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5
83+
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' =>4]),$plainPassword));
84+
}
85+
8286
$this->assertTrue($hasher->verify((newNativePasswordHasher(null,null,4, \PASSWORD_BCRYPT))->hash($plainPassword),$plainPassword));
8387
}
8488

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp