@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

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

+2 -9
-7
src/infrastructure/util/PhabricatorSlug.php
··· 42 42 43 43 $parts = explode('/', $slug); 44 44 45 - // Convert "_-_" into "-". This is a little nicer for inputs with 46 - // hyphens used as internal separators, and turns an input like "A - B" 47 - // into "a-b" instead of "a_-_b"; 48 - foreach ($parts as $key => $part) { 49 - $parts[$key] = str_replace('_-_', '-', $part); 50 - } 51 - 52 45 // Remove leading and trailing underscores from each component, if the 53 46 // component has not been reduced to a single underscore. For example, "a?" 54 47 // converts to "a", but "??" converts to "_".
+2 -2
src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php
··· 34 34 'a/??/c' => 'a/_/c/', 35 35 'a/?b/c' => 'a/b/c/', 36 36 'a/b?/c' => 'a/b/c/', 37 - 'a - b' => 'a-b/', 37 + 'a - b' => 'a_-_b/', 38 38 'a[b]' => 'a_b/', 39 39 'ab!' => 'ab!/', 40 40 ); ··· 51 51 $slugs = array( 52 52 'a:b' => 'a_b', 53 53 'a!b' => 'a_b', 54 - 'a - b' => 'a-b', 54 + 'a - b' => 'a_-_b', 55 55 '' => '', 56 56 'Demonology: HSA (Hexes, Signs, Alchemy)' => 57 57 'demonology_hsa_hexes_signs_alchemy',