Problem/Motivation
Hi,
I am getting this:
Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in _string_to_array()
Using PHP 8.1
modules/contrib/protected_forms/protected_forms.module
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | protected-forms-3340551-deprecated-string.patch | 831 bytes | j. |
Issue fork protected_forms-3340551
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
Comment #2
altagrade commentedAll issues must be filed against 2.0.x-dev. Feel free to re-open this ticket if it persists on 2.0.x-dev
Comment #3
j. commentedI am getting the error on 2.0.x-dev, 9.5, php 8.1. It happens after i logout/login.
Comment #4
j. commentedI think i found our problem. We aren't using any allowed patterns. So in our case $allowed_patterns is passing along an empty string, which then triggers the error in _string_to_array. This patch checks if $allowed_patterns has content before proceding.
Comment #7
keshavv commentedComment #8
tobiberlinI can confirm that the patch solves this issue
Comment #9
anybodyThe fix is strange, as the error in the issue summary is about
which is not affected here, but NULL-checked some lines before already.
This fix definitely doesn't make things worse, so let's merge it!
Comment #11
anybody