Differential D21757 Diff 51870 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | abstract class PhabricatorApplicationTransactionEditor | ||||
} | } | ||||
public function getMustEncrypt() { | public function getMustEncrypt() { | ||||
return $this->mustEncrypt; | return $this->mustEncrypt; | ||||
} | } | ||||
public function getHeraldRuleMonograms() { | public function getHeraldRuleMonograms() { | ||||
// Convert the stored "<123>, <456>" string into a list: "H123", "H456". | // Convert the stored "<123>, <456>" string into a list: "H123", "H456". | ||||
$list = $this->heraldHeader; | $list = phutil_string_cast($this->heraldHeader); | ||||
$list = preg_split('/[, ]+/', $list); | $list = preg_split('/[, ]+/', $list); | ||||
foreach ($list as $key => $item) { | foreach ($list as $key => $item) { | ||||
$item = trim($item, '<>'); | $item = trim($item, '<>'); | ||||
if (!is_numeric($item)) { | if (!is_numeric($item)) { | ||||
unset($list[$key]); | unset($list[$key]); | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 2,677 Lines • ▼ Show 20 Lines | |||||
* is an empty field. | * is an empty field. | ||||
* | * | ||||
* @param wild Current field value. | * @param wild Current field value. | ||||
* @param list<PhabricatorApplicationTransaction> Transactions editing the | * @param list<PhabricatorApplicationTransaction> Transactions editing the | ||||
* field. | * field. | ||||
* @return bool True if the field will be an empty text field after edits. | * @return bool True if the field will be an empty text field after edits. | ||||
*/ | */ | ||||
protected function validateIsEmptyTextField($field_value, array $xactions) { | protected function validateIsEmptyTextField($field_value, array $xactions) { | ||||
if (strlen($field_value) && empty($xactions)) { | if (($field_value !== null && strlen($field_value)) && empty($xactions)) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($xactions && strlen(last($xactions)->getNewValue())) { | if ($xactions && strlen(last($xactions)->getNewValue())) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 2,498 Lines • Show Last 20 Lines |