@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() error when database replication Seconds_Behind_Master is NULL

Summary:
When MySQL database replication is configured, but not running, the slave status Seconds_Behind_Master is NULL.
When this value is passed to strlen() an error is thrown.

Fixes T15507

Test Plan:
* Configure database replication such that Seconds_Behind_Master is NULL
* Restart php-fpm
* Go to Phorge web site.

Reviewers: O1 Blessed Committers, chris

Reviewed By: O1 Blessed Committers, chris

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

Maniphest Tasks: T15507

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

+1 -1
+1 -1
src/infrastructure/cluster/PhabricatorDatabaseRef.php
··· 393 393 394 394 if ($is_replica) { 395 395 $latency = idx($replica_status, 'Seconds_Behind_Master'); 396 - if (!strlen($latency)) { 396 + if (!phutil_nonempty_string($latency)) { 397 397 $ref->setReplicaStatus(self::REPLICATION_NOT_REPLICATING); 398 398 } else { 399 399 $latency = (int)$latency;