1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02: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:
epriestley 2016-01-18 09:09:02 -08:00
parent 10ef973735
commit cadd3f1056

View file

@ -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(),