Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception in PhabricatorMailSMTPAdapter when sending email
ClosedPublic

Authored by mturdus on Jun 15 2024, 12:40.

Details

Summary

strlen() was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/htdocs/phorge/phorge/src/applications/metamta/adapter/PhabricatorMailSMTPAdapter.php:65]

Closes T15857

Test Plan

Send Welcome email via 'Manage' user screen and Run ./bin/phd log afterwards to validate email action

Diff Detail

Repository
rP Phorge
Branch
master
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/extensions/example/src/query/ExampleQuery.php:7PHL1Unknown Symbol
Unit
Test Failures
Build Status
Buildable 1346
Build 1346: arc lint + arc unit

Unit TestsFailed

TimeTest
2,660 msPhabricatorLibraryTestCase::testMethodVisibility
Assertion failed, expected 'true' (at PhutilLibraryTestCase.php:144): Class "ExampleTable" implements method "getConfiguration" with the wrong visibility. The method has visibility "public", but it is defined in parent "PhabricatorLiskDAO" with visibility "protected". A method which overrides another must always have the same visibility.
860 msPhabricatorCelerityTestCase::testCelerityMaps
5 assertions passed.
728 msPhabricatorConduitTestCase::testConduitMethods
1 assertion passed.
477 msPhabricatorInfrastructureTestCase::testApplicationsInstalled
1 assertion passed.
479 msPhabricatorInfrastructureTestCase::testRejectMySQLNonUTF8Queries
1 assertion passed.
View Full Test Results (1 Failed · 7 Passed)

Event Timeline

mturdus requested review of this revision.Jun 15 2024, 12:40
mturdus retitled this revision from Fix PHP 8.1 "strlen(null)" exception in Diviner when sending email via SMTP to Fix PHP 8.1 "strlen(null)" exception in PhabricatorMailSMTPAdapter when sending email.Jun 15 2024, 12:43
This revision is now accepted and ready to land.Jun 15 2024, 13:12