@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15857

Differential Revision: https://we.phorge.it/D25692

+1 -1
+1 -1
src/applications/metamta/adapter/PhabricatorMailSMTPAdapter.php
··· 62 62 $smtp->Host = $this->getOption('host'); 63 63 $smtp->Port = $this->getOption('port'); 64 64 $user = $this->getOption('user'); 65 - if (strlen($user)) { 65 + if (phutil_nonempty_string($user)) { 66 66 $smtp->SMTPAuth = true; 67 67 $smtp->Username = $user; 68 68 $smtp->Password = $this->getOption('password');