From 034ff3c8708f4e7fc7eb5727f4a7ddfe107dd7e0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 15 Oct 2015 07:04:14 -0700 Subject: [PATCH] Remove "_-_" -> "-" slug behavior Summary: Fixes T9573. This incorrectly affected Phriction. I could restore it for only projects, but you didn't like the rule very much anyway and I don't feel strongly about it. Test Plan: Unit tests. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9573 Differential Revision: https://secure.phabricator.com/D14287 --- src/infrastructure/util/PhabricatorSlug.php | 7 ------- .../util/__tests__/PhabricatorSlugTestCase.php | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/infrastructure/util/PhabricatorSlug.php b/src/infrastructure/util/PhabricatorSlug.php index a6cf0bc70c..fd169914fe 100644 --- a/src/infrastructure/util/PhabricatorSlug.php +++ b/src/infrastructure/util/PhabricatorSlug.php @@ -42,13 +42,6 @@ final class PhabricatorSlug extends Phobject { $parts = explode('/', $slug); - // Convert "_-_" into "-". This is a little nicer for inputs with - // hyphens used as internal separators, and turns an input like "A - B" - // into "a-b" instead of "a_-_b"; - foreach ($parts as $key => $part) { - $parts[$key] = str_replace('_-_', '-', $part); - } - // Remove leading and trailing underscores from each component, if the // component has not been reduced to a single underscore. For example, "a?" // converts to "a", but "??" converts to "_". diff --git a/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php b/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php index e493ab7363..6a801bb54c 100644 --- a/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php +++ b/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php @@ -34,7 +34,7 @@ final class PhabricatorSlugTestCase extends PhabricatorTestCase { 'a/??/c' => 'a/_/c/', 'a/?b/c' => 'a/b/c/', 'a/b?/c' => 'a/b/c/', - 'a - b' => 'a-b/', + 'a - b' => 'a_-_b/', 'a[b]' => 'a_b/', 'ab!' => 'ab!/', ); @@ -51,7 +51,7 @@ final class PhabricatorSlugTestCase extends PhabricatorTestCase { $slugs = array( 'a:b' => 'a_b', 'a!b' => 'a_b', - 'a - b' => 'a-b', + 'a - b' => 'a_-_b', '' => '', 'Demonology: HSA (Hexes, Signs, Alchemy)' => 'demonology_hsa_hexes_signs_alchemy',