Skip to content

Update php-css-parser to fix PHP 8.4+ deprecations in emails - #3194

Open
faisalahammad wants to merge 1 commit into
Automattic:trunkfrom
faisalahammad:fix/php86-css-parser
Open

faisalahammad wants to merge 1 commit into
Automattic:trunkfrom
faisalahammad:fix/php86-css-parser

Conversation

@faisalahammad

Copy link
Copy Markdown
Contributor

Changes Proposed in this Pull Request

  • Update sabberworm/php-css-parser in composer.lock from v8.5.1 to v8.9.0. Only the lock file changes.
  • Emogrifier (CssInliner) uses this parser to inline the CSS in the HTML emails. On PHP 8.4 and newer, v8.5.1 logs these deprecations every time an email is styled:
Sabberworm\CSS\Parser::__construct(): Implicitly marking parameter $oParserSettings as nullable is deprecated ... Parser.php on line 24
Sabberworm\CSS\RuleSet\RuleSet::addRule(): Implicitly marking parameter $oSibling as nullable is deprecated ... RuleSet.php on line 105
Sabberworm\CSS\CSSList\Document::render(): Implicitly marking parameter $oOutputFormat as nullable is deprecated ... Document.php on line 158
  • v8.9.0 fixes these and is still inside the ^8.4.0 range that pelago/emogrifier 7.2 asks for. It still supports PHP 7.4, so composer.json and the other packages do not change.

Testing Instructions

  1. On a site with PHP 8.4 or newer, set WP_DEBUG and WP_DEBUG_LOG to true.
  2. On trunk, trigger any HTML email, for example submit a job as a guest so the "New Job Listing Submitted" admin email is sent.
  3. Check wp-content/debug.log and see the three Sabberworm\CSS\... lines above.
  4. Switch to this branch and run composer install, empty debug.log, and trigger the same email again.
  5. Expected: no Sabberworm lines in debug.log, and the email looks the same as before.

Automated checks I ran:

Release Notes

  • Fix PHP 8.4+ deprecation notices from the CSS parser used for HTML emails.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant