mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-08 10:24:48 +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) {
|
private function removeSlugs(PhabricatorProject $project, array $slugs) {
|
||||||
$slugs = $this->normalizeSlugs($slugs);
|
|
||||||
|
|
||||||
if (!$slugs) {
|
if (!$slugs) {
|
||||||
return;
|
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(
|
$objects = id(new PhabricatorProjectSlug())->loadAllWhere(
|
||||||
'projectPHID = %s AND slug IN (%Ls)',
|
'projectPHID = %s AND slug IN (%Ls)',
|
||||||
$project->getPHID(),
|
$project->getPHID(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue