Differential D25140 Diff 551 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 611 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
case PhabricatorTransactions::TYPE_SUBTYPE: | case PhabricatorTransactions::TYPE_SUBTYPE: | ||||
case PhabricatorTransactions::TYPE_HISTORY: | case PhabricatorTransactions::TYPE_HISTORY: | ||||
case PhabricatorTransactions::TYPE_FILE: | case PhabricatorTransactions::TYPE_FILE: | ||||
return $xaction->getNewValue(); | return $xaction->getNewValue(); | ||||
case PhabricatorTransactions::TYPE_MFA: | case PhabricatorTransactions::TYPE_MFA: | ||||
return true; | return true; | ||||
case PhabricatorTransactions::TYPE_SPACE: | case PhabricatorTransactions::TYPE_SPACE: | ||||
$space_phid = $xaction->getNewValue(); | $space_phid = $xaction->getNewValue(); | ||||
if (!strlen($space_phid)) { | if (!phutil_nonempty_string($space_phid)) { | ||||
valerio.bozzolan: ✅ It's OK to assume a PHID as string or as NULL (default). Alien values will be reported and… | |||||
// If an install has no Spaces or the Spaces controls are not visible | // If an install has no Spaces or the Spaces controls are not visible | ||||
// to the viewer, we might end up with the empty string here instead | // to the viewer, we might end up with the empty string here instead | ||||
// of a strict `null`, because some controller just used `getStr()` | // of a strict `null`, because some controller just used `getStr()` | ||||
// to read the space PHID from the request. | // to read the space PHID from the request. | ||||
// Just make this work like callers might reasonably expect so we | // Just make this work like callers might reasonably expect so we | ||||
// don't need to handle this specially in every EditController. | // don't need to handle this specially in every EditController. | ||||
return $this->getActor()->getDefaultSpacePHID(); | return $this->getActor()->getDefaultSpacePHID(); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 5,117 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ It's OK to assume a PHID as string or as NULL (default). Alien values will be reported and this is OK.