With PHP 8, the hash_pbkdf2 function raises a ValueError when invoked with an unknown algorithm, as opposed to its previous behavior where it would raise an E_WARNING and return a non-string value. This patch updates the Pbkdf2Password class to handle this exception and re-throw it as our PasswordError exception. It also adds a Phan stub for the ValueError exception if it is not defined to avoid superfluous analysis errors. Bug: T248925 Change-Id: I7e0ec4e95598af27fee8282c7e53bca5378e506a
6 lines
84 B
PHP
6 lines
84 B
PHP
<?php
|
|
|
|
// Stub for PHP 8's ValueError exception
|
|
|
|
class ValueError extends Error {
|
|
}
|