Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/phortune/xaction/PhortuneAccountNameTransaction.php b/src/applications/phortune/xaction/PhortuneAccountNameTransaction.php
index 08b8b69422..20272fda27 100644
--- a/src/applications/phortune/xaction/PhortuneAccountNameTransaction.php
+++ b/src/applications/phortune/xaction/PhortuneAccountNameTransaction.php
@@ -1,55 +1,55 @@
<?php
final class PhortuneAccountNameTransaction
extends PhortuneAccountTransactionType {
const TRANSACTIONTYPE = 'phortune:name';
public function generateOldValue($object) {
return $object->getName();
}
public function applyInternalEffects($object, $value) {
$object->setName($value);
}
public function getTitle() {
$old = $this->getOldValue();
$new = $this->getNewValue();
- if (strlen($old) && strlen($new)) {
+ if (phutil_nonempty_string($old) && phutil_nonempty_string($new)) {
return pht(
'%s renamed this account from %s to %s.',
$this->renderAuthor(),
$this->renderOldValue(),
$this->renderNewValue());
} else {
return pht(
'%s created this account.',
$this->renderAuthor());
}
}
public function validateTransactions($object, array $xactions) {
$errors = array();
if ($this->isEmptyTextTransaction($object->getName(), $xactions)) {
$errors[] = $this->newRequiredError(
pht('Accounts must have a name.'));
}
$max_length = $object->getColumnMaximumByteLength('name');
foreach ($xactions as $xaction) {
$new_value = $xaction->getNewValue();
$new_length = strlen($new_value);
if ($new_length > $max_length) {
$errors[] = $this->newRequiredError(
pht('The name can be no longer than %s characters.',
new PhutilNumber($max_length)));
}
}
return $errors;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, May 1, 9:00 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
108935
Default Alt Text
(1 KB)

Event Timeline