Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php b/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php
index 8927270c0d..954bf36b58 100644
--- a/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php
+++ b/src/applications/paste/xaction/PhabricatorPasteLanguageTransaction.php
@@ -1,57 +1,57 @@
<?php
final class PhabricatorPasteLanguageTransaction
extends PhabricatorPasteTransactionType {
const TRANSACTIONTYPE = 'paste.language';
public function generateOldValue($object) {
return $object->getLanguage();
}
public function applyInternalEffects($object, $value) {
$object->setLanguage($value);
}
private function renderLanguageValue($value) {
- if (!strlen($value)) {
+ if (!phutil_nonempty_string($value)) {
return $this->renderValue(pht('autodetect'));
} else {
return $this->renderValue($value);
}
}
public function getTitle() {
return pht(
"%s updated the paste's language from %s to %s.",
$this->renderAuthor(),
$this->renderLanguageValue($this->getOldValue()),
$this->renderLanguageValue($this->getNewValue()));
}
public function getTitleForFeed() {
return pht(
'%s updated the language for %s from %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderLanguageValue($this->getOldValue()),
$this->renderLanguageValue($this->getNewValue()));
}
public function validateTransactions($object, array $xactions) {
$errors = array();
foreach ($xactions as $xaction) {
$new = $xaction->getNewValue();
if ($new !== null && !strlen($new)) {
$errors[] = $this->newInvalidError(
pht('Paste language must be null or a nonempty string.'),
$xaction);
}
}
return $errors;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 3:08 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1186
Default Alt Text
(1 KB)

Event Timeline