We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.4 deprecated marking a parameter as nullable. For sites running Two Factor a PHP error shows up in the logs:
u2flib_server\Error::__construct(): Implicitly marking parameter $previous as nullable is deprecated, the explicit nullable type must be used instead
Stacktrace
wp-content/plugins/two-factor/includes/Yubico/U2F.php:504 Two_Factor_FIDO_U2F->__construct() wp-content/plugins/two-factor/providers/class-two-factor-provider.php:28 Two_Factor_Provider::get_instance() wp-content/plugins/two-factor/class-two-factor-core.php:291 Two_Factor_Core::get_providers() wp-includes/class-wp-hook.php:324 do_action('init') wp-settings.php:704
No response
PHP 8.4.2 WordPress 6.7.2
Yes
The text was updated successfully, but these errors were encountered:
I can open a PR but think we need to update line 504 to:
public function __construct($message, $code, $previous = null) {
Otherwise if we can bump the PHP version:
public function __construct($message, $code, \Exception|null $previous = null) {
Both fix the problem with PHP 8.4 so looking for input on the best way forward here.
Line with warning:https://github.com/WordPress/two-factor/blob/master/includes/Yubico/U2F.php#L504
Sorry, something went wrong.
Fixed in #664.
@felipeelia pointed out when working on the same problem for ElasticPress (10up/ElasticPress#4086) that we can use ? which is supported in PHP 7.1 so I went with that here. Thanks for the quick merge @kasparsd
?
No branches or pull requests
Describe the bug
PHP 8.4 deprecated marking a parameter as nullable. For sites running Two Factor a PHP error shows up in the logs:
Stacktrace
Steps to Reproduce
Screenshots, screen recording, code snippet
No response
Environment information
PHP 8.4.2
WordPress 6.7.2
Please confirm that you have searched existing issues in this repository.
Yes
Please confirm that you have tested with all plugins deactivated except Two-Factor.
Yes
The text was updated successfully, but these errors were encountered: