@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 on "Add Multi-Factor Auth" page

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.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

```
ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php:39]
```

Closes T16491

Test Plan:
* Be logged into Phorge
* Run `/var/www/html/phorge/phorge/bin/config set security.require-multi-factor-auth true`
* Reload a Phorge page to get the content of http://phorge.localhost/auth/enroll/multifactor/ displayed
* Visit also http://phorge.localhost/auth/

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16491

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

+1 -1
+1 -1
src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php
··· 36 36 ->getPanelKey(); 37 37 38 38 $panel_key = $request->getURIData('pageKey'); 39 - if (!strlen($panel_key)) { 39 + if (!phutil_nonempty_string($panel_key)) { 40 40 $panel_key = $multifactor_key; 41 41 } 42 42