Trim with null (deprecated/error) PHP 8.1

Created on 19 August 2022, over 2 years ago
Updated 28 June 2023, over 1 year ago

Problem/Motivation

At some point, in "smart_ip/src/SmartIp.php" file since

public static function query($ip = NULL)

accepts null value it could lead to

trim(): Passing null to parameter #1 ($string) of type string is deprecated in /web/modules/contrib/smart_ip/src/SmartIp.php line 30

and fatal error on execution

Steps to reproduce

Query with a null value / behat test

Proposed resolution

Check if value is null.

Remaining tasks

Fix

User interface changes

n/a

API changes

n/a (?)

Data model changes

n/a

🐛 Bug report
Status

RTBC

Version

4.2

Component

Code

Created by

🇫🇷France progzy

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024