preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\lazyloader\VisibilityChecker::isValidFilename()

Created on 11 October 2022, about 2 years ago
Updated 14 March 2023, almost 2 years ago

Problem/Motivation

Using Image Lazyloader on PHP 8.1 produces the following PHP deprecation message:

Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\lazyloader\VisibilityChecker->isValidFilename() (line 92 of modules/contrib/lazyloader/src/VisibilityChecker.php).

Proposed resolution

Fix the deprecation message.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇷🇺Russia qzmenko Novosibirsk

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024