@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix username route for new "._-" usernames

Summary: We allow ".", "_" and "-" in usernames now, but not in the route.

Test Plan: Went to /p/.-_/, got 404'd at the route level before and now make it to the profile controller.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1348

Differential Revision: https://secure.phabricator.com/D2729

+8 -1
+1 -1
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
··· 73 73 'edit/(?:(?P<id>\d+)/(?:(?P<view>\w+)/)?)?' 74 74 => 'PhabricatorPeopleEditController', 75 75 ), 76 - '/p/(?P<username>\w+)/(?:(?P<page>\w+)/)?' 76 + '/p/(?P<username>[\w._-]+)/(?:(?P<page>\w+)/)?' 77 77 => 'PhabricatorPeopleProfileController', 78 78 '/conduit/' => array( 79 79 '' => 'PhabricatorConduitListController',
+7
src/applications/people/storage/PhabricatorUser.php
··· 595 595 } 596 596 597 597 public static function validateUsername($username) { 598 + // NOTE: If you update this, make sure to update: 599 + // 600 + // - Remarkup rule for @mentions. 601 + // - Routing rule for "/p/username/". 602 + // - Unit tests, obviously. 603 + // - describeValidUsername() method, above. 604 + 598 605 return (bool)preg_match('/^[a-zA-Z0-9._-]*[a-zA-Z0-9_-]$/', $username); 599 606 } 600 607