1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Allow number in generated clone uri

Summary:
See https://discourse.phabricator-community.org/t/numerical-characters-are-stripped-from-diffusion-git-repository-name-in-the-uri/

Digits are often considered reasonable characters.

Test Plan: Looked at an ascii table.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, Sam2304, epriestley

Differential Revision: https://secure.phabricator.com/D19447
This commit is contained in:
Aviv Eyal 2018-05-11 16:18:06 +00:00 committed by avivey
parent 10a4b05ecb
commit 7281300446

View file

@ -364,7 +364,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
if (!strlen($name)) { if (!strlen($name)) {
$name = $this->getName(); $name = $this->getName();
$name = phutil_utf8_strtolower($name); $name = phutil_utf8_strtolower($name);
$name = preg_replace('@[/ -:<>]+@', '-', $name); $name = preg_replace('@[ -/:->]+@', '-', $name);
$name = trim($name, '-'); $name = trim($name, '-');
if (!strlen($name)) { if (!strlen($name)) {
$name = $this->getCallsign(); $name = $this->getCallsign();