Problem/Motivation

_filter_url_trim() can cause deprecations on PHP 8.1 because it passes NULL to \Drupal\Component\Utility\Unicode::truncate()

Steps to reproduce

Run Drupal\Tests\comment\Kernel\CommentDefaultFormatterCacheTags on PHP 8.1

Proposed resolution

The way _filter_url_trim() works with the statics is pretty horrible.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
939 bytes

Here's the simplest fix from the meta. There has to be a better way.

alexpott’s picture

I think though that the better way would involve a complete rewrite of all the _filter_* functions so not gonna happen here.

alexpott’s picture

Remove unrelated change.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Oof, but also yeah needs completely revising to do better than this.

Committed b7df0ea and pushed to 9.3.x. Thanks!

  • catch committed c62fe8e on 9.3.x
    Issue #3240228 by alexpott: _filter_url_trim() can cause deprecations on...

Status: Fixed » Closed (fixed)

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