Problem/Motivation

PHP 8.1 built-in string functions will trigger a deprecation error when a NULL is passed in. We often do this when getting something from the request headers.

Steps to reproduce

See test runs in #3220021: [meta] Ensure compatibility of Drupal 9 with PHP 8.1 (as it evolves)

Proposed resolution

Provide a better default value - ie. an empty string.

Remaining tasks

User interface changes

N/a

API changes

None

Data model changes

N/a

Release notes snippet

N/a

CommentFileSizeAuthor
#2 3236284-2.patch2.94 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +PHP 8.1
FileSize
2.94 KB
daffie’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

  • catch committed f601595 on 9.3.x
    Issue #3236284 by alexpott: Passing request headers to string functions...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed f601595 and pushed to 9.3.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.