PHP8.1: Deprecated function: trim()

Created on 14 July 2022, almost 2 years ago
Updated 22 February 2023, over 1 year ago

Problem/Motivation

PHP8.1 gives warning Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\broken_link\EventSubscriber\BrokenLinkSubscriber->handleBrokenLink() (line 48 of /var/web/vd16344/app/releases/117/web/modules/contrib/broken_link/src/EventSubscriber/BrokenLinkSubscriber.php)

Steps to reproduce

Random error.

Proposed resolution

Passing NULL to trim() or ltrim() or rtrim() is not allowed anymore in PHP 8.1. The code even explicitly checks for NULL (and not just an empty string)

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

RTBC

Version

3.1

Component

Code

Created by

πŸ‡΅πŸ‡°Pakistan monymirza Islamabad

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.

  • First commit to issue fork.
  • @urvashi_vora opened merge request.
Production build 0.69.0 2024