From a8bee72607dae20481c6ccba2ed07d3149d5ffdc Mon Sep 17 00:00:00 2001 From: Guilherme Ottoni Date: Mon, 9 Dec 2024 14:25:13 -0800 Subject: [PATCH] Improve robustness of test/zend/good/ext/standard/tests/strings/crypt.php Summary: When no salt (2nd arg) is passed to crypt(), it uses C++ std::rand() to produce a hash, causing the result to change based on whether calls to std::rand() are inserted/removed prior to the call to crypt(). Change the test to match any string hash returned by crypt() in such cases. Reviewed By: mdko Differential Revision: D66978809 fbshipit-source-id: f586ded68861f5b46aac23a87f95b481401c4e46 --- .../test/zend/good/ext/standard/tests/strings/crypt.php.expectf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hphp/test/zend/good/ext/standard/tests/strings/crypt.php.expectf b/hphp/test/zend/good/ext/standard/tests/strings/crypt.php.expectf index 1f84c3bae41e8..2e9c1189ae0f5 100644 --- a/hphp/test/zend/good/ext/standard/tests/strings/crypt.php.expectf +++ b/hphp/test/zend/good/ext/standard/tests/strings/crypt.php.expectf @@ -4,7 +4,7 @@ MD5 BLO Notice: crypt(): No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash. in %s/crypt.php on line 18 -string(34) "$1$bJoWf/..$V6Bfi7.4Xu0zVFzgX/sY91" +string(34) %s Warning: crypt() expects at least 1 parameter, 0 given in %s/crypt.php on line 19