Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/repository/xaction/PhabricatorRepositoryMaintenanceTransaction.php b/src/applications/repository/xaction/PhabricatorRepositoryMaintenanceTransaction.php
index caf9e84527..c1259aa983 100644
--- a/src/applications/repository/xaction/PhabricatorRepositoryMaintenanceTransaction.php
+++ b/src/applications/repository/xaction/PhabricatorRepositoryMaintenanceTransaction.php
@@ -1,43 +1,46 @@
<?php
final class PhabricatorRepositoryMaintenanceTransaction
extends PhabricatorRepositoryTransactionType {
const TRANSACTIONTYPE = 'maintenance';
public function generateOldValue($object) {
return $object->getReadOnlyMessage();
}
public function applyInternalEffects($object, $value) {
if ($value === null) {
$object
->setReadOnly(false)
->setReadOnlyMessage(null);
} else {
$object
->setReadOnly(true)
->setReadOnlyMessage($value);
}
}
public function getTitle() {
$old = $this->getOldValue();
$new = $this->getNewValue();
- if (strlen($old) && !strlen($new)) {
+ $old_nonempty = phutil_nonempty_string($old);
+ $new_nonempty = phutil_nonempty_string($new);
+
+ if ($old_nonempty && !$new_nonempty) {
return pht(
'%s took this repository out of maintenance mode.',
$this->renderAuthor());
- } else if (!strlen($old) && strlen($new)) {
+ } else if (!$old_nonempty && $new_nonempty) {
return pht(
'%s put this repository into maintenance mode.',
$this->renderAuthor());
} else {
return pht(
'%s updated the maintenance message for this repository.',
$this->renderAuthor());
}
}
}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Apr 30, 6:36 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
108790
Default Alt Text
(1 KB)

Event Timeline