1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 20:10:55 +01:00

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
This commit is contained in:
epriestley 2015-10-15 07:04:14 -07:00
parent f1552f54a0
commit 034ff3c870
2 changed files with 2 additions and 9 deletions

View file

@ -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 "_".

View file

@ -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',