Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
Show First 20 Lines • Show All 604 Lines • ▼ Show 20 Lines | public static function validateUsername($username) { | ||||
// - Routing rule for "/p/username/". | // - Routing rule for "/p/username/". | ||||
// - Unit tests, obviously. | // - Unit tests, obviously. | ||||
// - describeValidUsername() method, above. | // - describeValidUsername() method, above. | ||||
if (strlen($username) > self::MAXIMUM_USERNAME_LENGTH) { | if (strlen($username) > self::MAXIMUM_USERNAME_LENGTH) { | ||||
return false; | return false; | ||||
} | } | ||||
return (bool)preg_match('/^[a-zA-Z0-9._-]*[a-zA-Z0-9_-]$/', $username); | return (bool)preg_match('/^[a-zA-Z0-9._-]*[a-zA-Z0-9_-]\z/', $username); | ||||
} | } | ||||
public static function getDefaultProfileImageURI() { | public static function getDefaultProfileImageURI() { | ||||
return celerity_get_resource_uri('/rsrc/image/avatar.png'); | return celerity_get_resource_uri('/rsrc/image/avatar.png'); | ||||
} | } | ||||
public function attachStatus(PhabricatorCalendarEvent $status) { | public function attachStatus(PhabricatorCalendarEvent $status) { | ||||
$this->status = $status; | $this->status = $status; | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |