Skip to content

Commit 0ef08ba

Browse files
committed
Fix a PHP 8.1 deprecated use of strlen with a NULL argument
Summary: This strlen() call was preventing a new Phorge instance to be deployed/configured. Indeed, on a fresh instance, configuration's "base-uri" key may not be defined witch lead to a Runtime Exception. Using strlen() to check string validity 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. Fix T15605 Test Plan: - Checkout a fresh Phorge local copy from official 'https://we.phorge.it/source/phorge.git' - Install/Configure local webserver/database - Open http://phorge.domain in you browser - Configure Phorge database (as requested by webpage) - Create Phorge database (as requested by webpage) - You should be able to reach administrator account page instead of getting a RuntimeException Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15605 Differential Revision: https://we.phorge.it/D25394
1 parent 7f46a25 commit 0ef08ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/applications/config/check/PhabricatorWebServerSetupCheck.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function executeChecks() {
2323
}
2424

2525
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
26-
if (!strlen($base_uri)) {
26+
if (!$base_uri) {
2727
// If `phabricator.base-uri` is not set then we can't really do
2828
// anything.
2929
return;

0 commit comments

Comments
 (0)