Unset global password can cause Deprecated function error

Created on 6 September 2023, about 1 year ago
Updated 18 January 2024, 10 months ago

Problem/Motivation

If module is set to check for a global password but a global password is not set in configuration, the user may encounter:

Deprecated function: password_verify(): Passing null to parameter #2 ($hash) of type string is deprecated in Drupal\Core\Password\PhpPassword->check() (line 49 of core/lib/Drupal/Core/Password/PhpPassword.php).

Steps to reproduce

  • Install module
  • Set Global password setting to "Allow per page or Global" or "Allow only Global"
  • Do not set a Global Password
  • Add a protected page and attempt to authenticate

Proposed resolution

Check for null value on global password before check() call.

๐Ÿ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024