Skip to content

Message::setHTML will produce deprecation warnings in PHP 8 if null is passed #15

@vortrixs

Description

@vortrixs

mail/src/Message.php

Lines 347 to 351 in 92f2ce0

public function setHTML(?string $html): void
{
if (preg_match('//u', $html) !== 1) {
throw new InvalidArgumentException("message body contains an invalid UTF-8 byte sequence");
}
This will trigger a deprecation warning if null is passed because preg_match only accepts strings as of PHP 8.

Error: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions