PHP 8 compatibility issue

Created on 15 December 2022, over 1 year ago
Updated 1 May 2023, about 1 year ago

Problem/Motivation

PHP 8 is stricter about values passed to string functions. In this case the substr_count function gives errors.

Steps to reproduce

Have an empty string as a config value in the blocklist_exceptions key. Try to save a node with a value that has a text value with blocklisted URIs.

Proposed resolution

Fix the issue by checking for empty (or null) strings before passing to the function. Or better yet, fix the value acquisition from the config so that there are no empty strings in the interpreted configuration.

Remaining tasks

Review patch

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇮Finland kekkis Pirkkala

Live updates comments and jobs are added and updated live.
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.

Production build 0.69.0 2024