mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
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
This commit is contained in:
parent
0a17287e08
commit
101ce834b8
1 changed files with 1 additions and 1 deletions
|
@ -393,7 +393,7 @@ final class PhabricatorDatabaseRef
|
|||
|
||||
if ($is_replica) {
|
||||
$latency = idx($replica_status, 'Seconds_Behind_Master');
|
||||
if (!strlen($latency)) {
|
||||
if (!phutil_nonempty_string($latency)) {
|
||||
$ref->setReplicaStatus(self::REPLICATION_NOT_REPLICATING);
|
||||
} else {
|
||||
$latency = (int)$latency;
|
||||
|
|
Loading…
Reference in a new issue