Deprecated function: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in pet_parse_mails() (line 55 of /app/web/modules/composer/pet/pet.module)

Created on 12 May 2023, over 1 year ago
Updated 14 June 2023, over 1 year ago

Problem/Motivation

When function pet_parse_mails($mail_text) receives NULL in $mail_text, PHP throws a warning like this:

Deprecated function: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in pet_parse_mails() (line 55 of /app/web/modules/composer/pet/pet.module)

Steps to reproduce

- Create a PET
- Trigger an email using a PET without a cc and without a bcc

Proposed resolution

If $mail_text is not a valid string, early return an empty array.

Remaining tasks

Make patch.

🐛 Bug report
Status

Fixed

Version

4.2

Component

Code

Created by

🇨🇴Colombia camilo.escobar

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

Comments & Activities

Production build 0.71.5 2024