Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F261050
example.diff
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
epriestley
Jan 3 2015, 11:41 PM
2015-01-03 23:41:48 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
example.diff
View Options
diff --git a/src/applications/repository/editor/PhabricatorRepositoryEditor.php b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
index 5335fa2..bb94a9f 100644
--- a/src/applications/repository/editor/PhabricatorRepositoryEditor.php
+++ b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
@@ -330,6 +330,25 @@ final class PhabricatorRepositoryEditor
$errors = parent::validateTransaction($object, $type, $xactions);
switch ($type) {
+ case PhabricatorRepositoryTransaction::TYPE_NAME:
+ foreach ($xactions as $xaction) {
+ $username = $this->getActor()->getUsername();
+ $reponame = $xaction->getNewValue();
+
+ $prefix = $username.'-';
+ if (strncmp($reponame, $prefix, strlen($prefix)) {
+ $error = new PhabricatorApplicationTransactionValidationError(
+ $type,
+ pht('Invalid'),
+ pht(
+ 'Repositories must be prefixed with your username, like '.
+ '"%s".',
+ "{$prefix}example"),
+ $xaction);
+ $errors[] = $error;
+ }
+ }
+ break;
case PhabricatorRepositoryTransaction::TYPE_AUTOCLOSE:
case PhabricatorRepositoryTransaction::TYPE_TRACK_ONLY:
foreach ($xactions as $xaction) {
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/qq/fy/lfct3awpoofnbpuk
Default Alt Text
example.diff (1 KB)
Attached To
Mode
P1692 example.diff
Attached
Detach File
Event Timeline
Log In to Comment