1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Preventing duplicate empty string aliases in Phurl's

Summary: Ref T8992, Make it impossible to save an empty string alias for a Phurl.

Test Plan:
- Create two Phurl's with non-empty aliases
- Delete aliases for both Phurl's
- Previously, this wouldn't allow to save the second Phurl because of a duplicate alias. Current diff should save empty alias as `null`, not empty string.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T8992

Differential Revision: https://secure.phabricator.com/D14413
This commit is contained in:
lkassianik 2015-11-05 10:11:13 -08:00
parent 9366edf255
commit e2c0df4fb4

View file

@ -49,9 +49,13 @@ final class PhabricatorPhurlURLEditor
switch ($xaction->getTransactionType()) {
case PhabricatorPhurlURLTransaction::TYPE_NAME:
case PhabricatorPhurlURLTransaction::TYPE_URL:
case PhabricatorPhurlURLTransaction::TYPE_ALIAS:
case PhabricatorPhurlURLTransaction::TYPE_DESCRIPTION:
return $xaction->getNewValue();
case PhabricatorPhurlURLTransaction::TYPE_ALIAS:
if (!strlen($xaction->getNewValue())) {
return null;
}
return $xaction->getNewValue();
}
return parent::getCustomTransactionNewValue($object, $xaction);