mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
When removing project slugs, try to remove raw slugs too so we can remove old/invalid slugs
Summary: Ref T10168. When we try to remove an additional hashtag, we remove the normalized version. Instead, remove both the literal and normalized versions. This allows us to remove old/invalid slugs. Test Plan: Removed garbage slugs like `[,*,]`. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10168 Differential Revision: https://secure.phabricator.com/D15048
This commit is contained in:
parent
10ef973735
commit
cadd3f1056
1 changed files with 7 additions and 2 deletions
|
@ -756,12 +756,17 @@ final class PhabricatorProjectTransactionEditor
|
|||
}
|
||||
|
||||
private function removeSlugs(PhabricatorProject $project, array $slugs) {
|
||||
$slugs = $this->normalizeSlugs($slugs);
|
||||
|
||||
if (!$slugs) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We're going to try to delete both the literal and normalized versions
|
||||
// of all slugs. This allows us to destroy old slugs that are no longer
|
||||
// valid.
|
||||
foreach ($this->normalizeSlugs($slugs) as $slug) {
|
||||
$slugs[] = $slug;
|
||||
}
|
||||
|
||||
$objects = id(new PhabricatorProjectSlug())->loadAllWhere(
|
||||
'projectPHID = %s AND slug IN (%Ls)',
|
||||
$project->getPHID(),
|
||||
|
|
Loading…
Reference in a new issue