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.

CommentFileSizeAuthor
#2 pet-3360120.patch373 bytescamilo.escobar

Comments

camilo.escobar created an issue. See original summary.

camilo.escobar’s picture

StatusFileSize
new373 bytes

  • camilo.escobar authored 14fd3e85 on 8.x-4.x
    Issue #3360120 by camilo.escobar: Deprecated function: preg_split():...
sharique’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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