Problem/Motivation

When token_element_validate is used on a field that return a NULL value in PHP 8.1, a deprecation is triggered
Deprecated function: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in token_element_validate()

Proposed resolution

We could replace mb_strlen with empty as the result would be the same and this may be a slight performance boost.

CommentFileSizeAuthor
#2 token-php_deprecation-3264294-2.patch539 bytesaerzas

Issue fork token-3264294

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Aerzas created an issue. See original summary.

aerzas’s picture

Status: Active » Needs review
Issue tags: +Needs review
StatusFileSize
new539 bytes

Here is the related patch.

Berdir made their first commit to this issue’s fork.

  • Berdir committed 1b13d72 on 8.x-1.x authored by Aerzas
    Issue #3264294 by Aerzas: PHP 8.1 deprecation in token_element_validate
    
berdir’s picture

Status: Needs review » Fixed

Merged, thanks.

Status: Fixed » Closed (fixed)

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