PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in docroot/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php on line 112

Created on 20 December 2022, over 1 year ago
Updated 5 July 2023, 11 months ago

Problem/Motivation

Running drush to send mail I see deprecation in logs because SERVER_SOFTWARE environment variable is not set.

PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in docroot/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php on line 112

the most common case is checking for updates and sending mail

Steps to reproduce

run drush to execute job to send mail and then check logs

Proposed resolution

- Use common across core the check for windows git grep PHP_OS which is substr(PHP_OS, 0, 3) == 'WIN'
- deprecate unused property in 📌 Deprecate PHPMail::request property Postponed
- decide fate of platform in 🌱 [policy, no patch] Drop support for Windows in production Needs review as looks the check failing since Drupal 7 - 🐛 Truncated MailFrom address - Incorrect Windows detection Active

Remaining tasks

- patch
- add test and commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

🐛 Bug report
Status

Needs work

Version

10.0

Component
Mail 

Last updated 1 day ago

No maintainer
Created by

🇮🇳India Rajeshreeputra Pune

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024