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

CommentFileSizeAuthor
#4 3240228-4.patch441 bytesalexpott
#2 3240228-2.patch939 bytesalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new939 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

StatusFileSize
new441 bytes

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.