PhabricatorSlug
Summary: This is to be used in Phame so the logic is shared where possible. The change has three main things going on - broke out functionality from PhrictionDocument that isn't Phriction specific. - swept up code base to use new PhabricatorSlug class. - altered the regex ever so slightly per discussion and http://stackoverflow.com/questions/2028022/javascript-how-to-convert-unicode-string-to-ascii I think maybe we should punt on unicode here for quite a bit -- http://www.456bereastreet.com/archive/201006/be_careful_with_non-ascii_characters_in_urls/ -- but we'll be well-positioned to add it with the code here. Test Plan: used phriction to create, edit, view documents. used a tool (codemod) for the codebase sweeping Reviewers: epriestley Reviewed By: epriestley CC: aran Differential Revision: https://secure.phabricator.com/D2195
This commit is contained in:
@@ -60,7 +60,7 @@ final class PhabricatorProjectProfileController
|
||||
|
||||
$external_arrow = "\xE2\x86\x97";
|
||||
$tasks_uri = '/maniphest/view/all/?projects='.$project->getPHID();
|
||||
$slug = PhrictionDocument::normalizeSlug($project->getName());
|
||||
$slug = PhabricatorSlug::normalize($project->getName());
|
||||
$phriction_uri = '/w/projects/'.$slug;
|
||||
|
||||
$edit_uri = '/project/edit/'.$project->getID().'/';
|
||||
|
||||
@@ -13,12 +13,12 @@ phutil_require_module('phabricator', 'applications/files/storage/file');
|
||||
phutil_require_module('phabricator', 'applications/maniphest/query');
|
||||
phutil_require_module('phabricator', 'applications/maniphest/view/tasksummary');
|
||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||
phutil_require_module('phabricator', 'applications/phriction/storage/document');
|
||||
phutil_require_module('phabricator', 'applications/project/controller/base');
|
||||
phutil_require_module('phabricator', 'applications/project/storage/profile');
|
||||
phutil_require_module('phabricator', 'applications/project/storage/project');
|
||||
phutil_require_module('phabricator', 'infrastructure/celerity/api');
|
||||
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
|
||||
phutil_require_module('phabricator', 'infrastructure/util/slug');
|
||||
phutil_require_module('phabricator', 'view/control/table');
|
||||
phutil_require_module('phabricator', 'view/layout/profileheader');
|
||||
phutil_require_module('phabricator', 'view/layout/sidenavfilter');
|
||||
|
||||
@@ -82,7 +82,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO {
|
||||
// 'hack_slash' instead of 'hack/slash').
|
||||
|
||||
$slug = str_replace('/', ' ', $slug);
|
||||
$slug = PhrictionDocument::normalizeSlug($slug);
|
||||
$slug = PhabricatorSlug::normalize($slug);
|
||||
$this->phrictionSlug = $slug;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
phutil_require_module('phabricator', 'applications/phid/constants');
|
||||
phutil_require_module('phabricator', 'applications/phid/storage/phid');
|
||||
phutil_require_module('phabricator', 'applications/phriction/storage/document');
|
||||
phutil_require_module('phabricator', 'applications/project/constants/status');
|
||||
phutil_require_module('phabricator', 'applications/project/storage/affiliation');
|
||||
phutil_require_module('phabricator', 'applications/project/storage/base');
|
||||
phutil_require_module('phabricator', 'applications/project/storage/profile');
|
||||
phutil_require_module('phabricator', 'applications/project/storage/subproject');
|
||||
phutil_require_module('phabricator', 'infrastructure/util/slug');
|
||||
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user