Permalink
Browse files

Require canonical numbers in routes

Summary:
D03646 works, I don't want it to work.
Theoretically, it can cause us some troubles if we use this string in JS number context where 030 is 24.

Test Plan: D03646, D3646

Reviewers: epriestley, edward

Reviewed By: edward

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3646
  • Loading branch information...
1 parent 26d62ee commit 22cb8f5d08a6244b6638c2f9f23ac773559b056d vrana committed Oct 5, 2012
Showing with 62 additions and 57 deletions.
  1. +1 −1 src/applications/audit/application/PhabricatorApplicationAudit.php
  2. +3 −3 src/applications/countdown/application/PhabricatorApplicationCountdown.php
  3. +5 −4 src/applications/daemon/application/PhabricatorApplicationDaemons.php
  4. +9 −8 src/applications/differential/application/PhabricatorApplicationDifferential.php
  5. +2 −2 src/applications/files/application/PhabricatorApplicationFiles.php
  6. +1 −1 src/applications/flag/application/PhabricatorApplicationFlags.php
  7. +4 −4 src/applications/herald/application/PhabricatorApplicationHerald.php
  8. +2 −2 src/applications/macro/application/PhabricatorApplicationMacro.php
  9. +2 −1 src/applications/mailinglists/application/PhabricatorApplicationMailingLists.php
  10. +7 −6 src/applications/maniphest/application/PhabricatorApplicationManiphest.php
  11. +1 −1 src/applications/metamta/application/PhabricatorApplicationMetaMTA.php
  12. +3 −3 src/applications/owners/application/PhabricatorApplicationOwners.php
  13. +2 −2 src/applications/paste/application/PhabricatorApplicationPaste.php
  14. +1 −1 src/applications/people/application/PhabricatorApplicationPeople.php
  15. +3 −3 src/applications/phriction/application/PhabricatorApplicationPhriction.php
  16. +1 −1 src/applications/ponder/application/PhabricatorApplicationPonder.php
  17. +5 −4 src/applications/project/application/PhabricatorApplicationProject.php
  18. +4 −4 src/applications/repository/application/PhabricatorApplicationRepositories.php
  19. +1 −1 src/applications/slowvote/application/PhabricatorApplicationSlowvote.php
  20. +5 −5 src/applications/xhpastview/application/PhabricatorApplicationPHPAST.php
@@ -37,7 +37,7 @@ public function getRoutes() {
'view/(?P<filter>[^/]+)/(?:(?P<name>[^/]+)/)?'
=> 'PhabricatorAuditListController',
'addcomment/' => 'PhabricatorAuditAddCommentController',
- 'preview/(?P<id>\d+)/' => 'PhabricatorAuditPreviewController',
+ 'preview/(?P<id>[1-9]\d*)/' => 'PhabricatorAuditPreviewController',
),
);
}
@@ -47,11 +47,11 @@ public function getRoutes() {
'/countdown/' => array(
''
=> 'PhabricatorCountdownListController',
- '(?P<id>\d+)/'
+ '(?P<id>[1-9]\d*)/'
=> 'PhabricatorCountdownViewController',
- 'edit/(?:(?P<id>\d+)/)?'
+ 'edit/(?:(?P<id>[1-9]\d*)/)?'
=> 'PhabricatorCountdownEditController',
- 'delete/(?P<id>\d+)/'
+ 'delete/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCountdownDeleteController'
),
);
@@ -45,16 +45,17 @@ public function getApplicationGroup() {
public function getRoutes() {
return array(
'/daemon/' => array(
- 'task/(?P<id>\d+)/' => 'PhabricatorWorkerTaskDetailController',
- 'task/(?P<id>\d+)/(?P<action>[^/]+)/'
+ 'task/(?P<id>[1-9]\d*)/' => 'PhabricatorWorkerTaskDetailController',
+ 'task/(?P<id>[1-9]\d*)/(?P<action>[^/]+)/'
=> 'PhabricatorWorkerTaskUpdateController',
'log/' => array(
'(?P<running>running/)?' => 'PhabricatorDaemonLogListController',
'combined/' => 'PhabricatorDaemonCombinedLogController',
- '(?P<id>\d+)/' => 'PhabricatorDaemonLogViewController',
+ '(?P<id>[1-9]\d*)/' => 'PhabricatorDaemonLogViewController',
),
'timeline/' => 'PhabricatorDaemonTimelineConsoleController',
- 'timeline/(?P<id>\d+)/' => 'PhabricatorDaemonTimelineEventController',
+ 'timeline/(?P<id>[1-9]\d*)/'
+ => 'PhabricatorDaemonTimelineEventController',
'' => 'PhabricatorDaemonConsoleController',
),
);
@@ -38,29 +38,30 @@ public function getFactObjectsForAnalysis() {
public function getRoutes() {
return array(
- '/D(?P<id>\d+)' => 'DifferentialRevisionViewController',
+ '/D(?P<id>[1-9]\d*)' => 'DifferentialRevisionViewController',
'/differential/' => array(
'' => 'DifferentialRevisionListController',
'filter/(?P<filter>\w+)/(?:(?P<username>[\w\.-_]+)/)?' =>
'DifferentialRevisionListController',
'stats/(?P<filter>\w+)/' => 'DifferentialRevisionStatsController',
'diff/' => array(
- '(?P<id>\d+)/' => 'DifferentialDiffViewController',
+ '(?P<id>[1-9]\d*)/' => 'DifferentialDiffViewController',
'create/' => 'DifferentialDiffCreateController',
),
'changeset/' => 'DifferentialChangesetViewController',
- 'revision/edit/(?:(?P<id>\d+)/)?'
+ 'revision/edit/(?:(?P<id>[1-9]\d*)/)?'
=> 'DifferentialRevisionEditController',
'comment/' => array(
- 'preview/(?P<id>\d+)/' => 'DifferentialCommentPreviewController',
+ 'preview/(?P<id>[1-9]\d*)/' => 'DifferentialCommentPreviewController',
'save/' => 'DifferentialCommentSaveController',
'inline/' => array(
- 'preview/(?P<id>\d+)/' =>
- 'DifferentialInlineCommentPreviewController',
- 'edit/(?P<id>\d+)/' => 'DifferentialInlineCommentEditController',
+ 'preview/(?P<id>[1-9]\d*)/'
+ => 'DifferentialInlineCommentPreviewController',
+ 'edit/(?P<id>[1-9]\d*)/'
+ => 'DifferentialInlineCommentEditController',
),
),
- 'subscribe/(?P<action>add|rem)/(?P<id>\d+)/'
+ 'subscribe/(?P<action>add|rem)/(?P<id>[1-9]\d*)/'
=> 'DifferentialSubscribeController',
),
);
@@ -44,13 +44,13 @@ public function getApplicationGroup() {
public function getRoutes() {
return array(
- '/F(?P<id>\d+)' => 'PhabricatorFileShortcutController',
+ '/F(?P<id>[1-9]\d*)' => 'PhabricatorFileShortcutController',
'/file/' => array(
'' => 'PhabricatorFileListController',
'filter/(?P<filter>\w+)/' => 'PhabricatorFileListController',
'upload/' => 'PhabricatorFileUploadController',
'dropupload/' => 'PhabricatorFileDropUploadController',
- 'delete/(?P<id>\d+)/' => 'PhabricatorFileDeleteController',
+ 'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorFileDeleteController',
'info/(?P<phid>[^/]+)/' => 'PhabricatorFileInfoController',
'data/(?P<key>[^/]+)/(?P<phid>[^/]+)/.*'
=> 'PhabricatorFileDataController',
@@ -65,7 +65,7 @@ public function getRoutes() {
'' => 'PhabricatorFlagListController',
'view/(?P<view>[^/]+)/' => 'PhabricatorFlagListController',
'edit/(?P<phid>[^/]+)/' => 'PhabricatorFlagEditController',
- 'delete/(?P<id>\d+)/' => 'PhabricatorFlagDeleteController',
+ 'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorFlagDeleteController',
),
);
}
@@ -54,12 +54,12 @@ public function getRoutes() {
=> 'HeraldHomeController',
'new/(?:(?P<type>[^/]+)/(?:(?P<rule_type>[^/]+)/)?)?'
=> 'HeraldNewController',
- 'rule/(?:(?P<id>\d+)/)?' => 'HeraldRuleController',
- 'history/(?:(?P<id>\d+)/)?' => 'HeraldRuleEditHistoryController',
- 'delete/(?P<id>\d+)/' => 'HeraldDeleteController',
+ 'rule/(?:(?P<id>[1-9]\d*)/)?' => 'HeraldRuleController',
+ 'history/(?:(?P<id>[1-9]\d*)/)?' => 'HeraldRuleEditHistoryController',
+ 'delete/(?P<id>[1-9]\d*)/' => 'HeraldDeleteController',
'test/' => 'HeraldTestConsoleController',
'transcript/' => 'HeraldTranscriptListController',
- 'transcript/(?P<id>\d+)/(?:(?P<filter>\w+)/)?'
+ 'transcript/(?P<id>[1-9]\d*)/(?:(?P<filter>\w+)/)?'
=> 'HeraldTranscriptController',
),
);
@@ -42,8 +42,8 @@ public function getRoutes() {
return array(
'/macro/' => array(
'' => 'PhabricatorMacroListController',
- 'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorMacroEditController',
- 'delete/(?P<id>\d+)/' => 'PhabricatorMacroDeleteController',
+ 'edit/(?:(?P<id>[1-9]\d*)/)?' => 'PhabricatorMacroEditController',
+ 'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorMacroDeleteController',
),
);
}
@@ -42,7 +42,8 @@ public function getRoutes() {
return array(
'/mailinglists/' => array(
'' => 'PhabricatorMailingListsListController',
- 'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorMailingListsEditController',
+ 'edit/(?:(?P<id>[1-9]\d*)/)?'
+ => 'PhabricatorMailingListsEditController',
),
);
}
@@ -50,30 +50,31 @@ public function getFactObjectsForAnalysis() {
public function getRoutes() {
return array(
- '/T(?P<id>\d+)' => 'ManiphestTaskDetailController',
+ '/T(?P<id>[1-9]\d*)' => 'ManiphestTaskDetailController',
'/maniphest/' => array(
'' => 'ManiphestTaskListController',
'view/(?P<view>\w+)/' => 'ManiphestTaskListController',
'report/(?:(?P<view>\w+)/)?' => 'ManiphestReportController',
'batch/' => 'ManiphestBatchEditController',
'task/' => array(
'create/' => 'ManiphestTaskEditController',
- 'edit/(?P<id>\d+)/' => 'ManiphestTaskEditController',
- 'descriptionchange/(?:(?P<id>\d+)/)?' =>
+ 'edit/(?P<id>[1-9]\d*)/' => 'ManiphestTaskEditController',
+ 'descriptionchange/(?:(?P<id>[1-9]\d*)/)?' =>
'ManiphestTaskDescriptionChangeController',
'descriptionpreview/' =>
'ManiphestTaskDescriptionPreviewController',
),
'transaction/' => array(
'save/' => 'ManiphestTransactionSaveController',
- 'preview/(?P<id>\d+)/' => 'ManiphestTransactionPreviewController',
+ 'preview/(?P<id>[1-9]\d*)/'
+ => 'ManiphestTransactionPreviewController',
),
'export/(?P<key>[^/]+)/' => 'ManiphestExportController',
'subpriority/' => 'ManiphestSubpriorityController',
'custom/' => array(
'' => 'ManiphestSavedQueryListController',
- 'edit/(?:(?P<id>\d+)/)?' => 'ManiphestSavedQueryEditController',
- 'delete/(?P<id>\d+)/' => 'ManiphestSavedQueryDeleteController',
+ 'edit/(?:(?P<id>[1-9]\d*)/)?' => 'ManiphestSavedQueryEditController',
+ 'delete/(?P<id>[1-9]\d*)/' => 'ManiphestSavedQueryDeleteController',
),
),
);
@@ -43,7 +43,7 @@ public function getRoutes() {
$this->getBaseURI() => array(
'' => 'PhabricatorMetaMTAListController',
'send/' => 'PhabricatorMetaMTASendController',
- 'view/(?P<id>\d+)/' => 'PhabricatorMetaMTAViewController',
+ 'view/(?P<id>[1-9]\d*)/' => 'PhabricatorMetaMTAViewController',
'receive/' => 'PhabricatorMetaMTAReceiveController',
'received/' => 'PhabricatorMetaMTAReceivedListController',
'sendgrid/' => 'PhabricatorMetaMTASendGridReceiveController',
@@ -51,10 +51,10 @@ public function getRoutes() {
'/owners/' => array(
'' => 'PhabricatorOwnersListController',
'view/(?P<view>[^/]+)/' => 'PhabricatorOwnersListController',
- 'edit/(?P<id>\d+)/' => 'PhabricatorOwnersEditController',
+ 'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorOwnersEditController',
'new/' => 'PhabricatorOwnersEditController',
- 'package/(?P<id>\d+)/' => 'PhabricatorOwnersDetailController',
- 'delete/(?P<id>\d+)/' => 'PhabricatorOwnersDeleteController',
+ 'package/(?P<id>[1-9]\d*)/' => 'PhabricatorOwnersDetailController',
+ 'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorOwnersDeleteController',
),
);
}
@@ -36,10 +36,10 @@ public function getApplicationGroup() {
public function getRoutes() {
return array(
- '/P(?P<id>\d+)' => 'PhabricatorPasteViewController',
+ '/P(?P<id>[1-9]\d*)' => 'PhabricatorPasteViewController',
'/paste/' => array(
'' => 'PhabricatorPasteEditController',
- 'edit/(?P<id>\d+)/' => 'PhabricatorPasteEditController',
+ 'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteEditController',
'filter/(?P<filter>\w+)/' => 'PhabricatorPasteListController',
),
);
@@ -47,7 +47,7 @@ public function getRoutes() {
'/people/' => array(
'' => 'PhabricatorPeopleListController',
'logs/' => 'PhabricatorPeopleLogsController',
- 'edit/(?:(?P<id>\d+)/(?:(?P<view>\w+)/)?)?'
+ 'edit/(?:(?P<id>[1-9]\d*)/(?:(?P<view>\w+)/)?)?'
=> 'PhabricatorPeopleEditController',
'ldap/' => 'PhabricatorPeopleLdapController',
),
@@ -48,11 +48,11 @@ public function getRoutes() {
'history(?P<slug>/)' => 'PhrictionHistoryController',
'history/(?P<slug>.+/)' => 'PhrictionHistoryController',
- 'edit/(?:(?P<id>\d+)/)?' => 'PhrictionEditController',
- 'delete/(?P<id>\d+)/' => 'PhrictionDeleteController',
+ 'edit/(?:(?P<id>[1-9]\d*)/)?' => 'PhrictionEditController',
+ 'delete/(?P<id>[1-9]\d*)/' => 'PhrictionDeleteController',
'preview/' => 'PhrictionDocumentPreviewController',
- 'diff/(?P<id>\d+)/' => 'PhrictionDiffController',
+ 'diff/(?P<id>[1-9]\d*)/' => 'PhrictionDiffController',
),
);
}
@@ -49,7 +49,7 @@ public function getApplicationGroup() {
public function getroutes() {
return array(
- '/Q(?P<id>\d+)' => 'PonderQuestionViewController',
+ '/Q(?P<id>[1-9]\d*)' => 'PonderQuestionViewController',
'/ponder/' => array(
'(?P<page>feed/)?' => 'PonderFeedController',
'(?P<page>questions)/' => 'PonderFeedController',
@@ -47,12 +47,13 @@ public function getRoutes() {
'/project/' => array(
'' => 'PhabricatorProjectListController',
'filter/(?P<filter>[^/]+)/' => 'PhabricatorProjectListController',
- 'edit/(?P<id>\d+)/' => 'PhabricatorProjectProfileEditController',
- 'members/(?P<id>\d+)/' => 'PhabricatorProjectMembersEditController',
- 'view/(?P<id>\d+)/(?:(?P<page>\w+)/)?'
+ 'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectProfileEditController',
+ 'members/(?P<id>[1-9]\d*)/'
+ => 'PhabricatorProjectMembersEditController',
+ 'view/(?P<id>[1-9]\d*)/(?:(?P<page>\w+)/)?'
=> 'PhabricatorProjectProfileController',
'create/' => 'PhabricatorProjectCreateController',
- 'update/(?P<id>\d+)/(?P<action>[^/]+)/'
+ 'update/(?P<id>[1-9]\d*)/(?P<action>[^/]+)/'
=> 'PhabricatorProjectUpdateController',
),
);
@@ -43,12 +43,12 @@ public function getRoutes() {
'/repository/' => array(
'' => 'PhabricatorRepositoryListController',
'create/' => 'PhabricatorRepositoryCreateController',
- 'edit/(?P<id>\d+)/(?:(?P<view>\w+)/)?' =>
+ 'edit/(?P<id>[1-9]\d*)/(?:(?P<view>\w+)/)?' =>
'PhabricatorRepositoryEditController',
- 'delete/(?P<id>\d+)/' => 'PhabricatorRepositoryDeleteController',
- 'project/edit/(?P<id>\d+)/' =>
+ 'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorRepositoryDeleteController',
+ 'project/edit/(?P<id>[1-9]\d*)/' =>
'PhabricatorRepositoryArcanistProjectEditController',
- 'project/delete/(?P<id>\d+)/' =>
+ 'project/delete/(?P<id>[1-9]\d*)/' =>
'PhabricatorRepositoryArcanistProjectDeleteController',
),
);
@@ -48,7 +48,7 @@ public function getApplicationGroup() {
public function getRoutes() {
return array(
- '/V(?P<id>\d+)' => 'PhabricatorSlowvotePollController',
+ '/V(?P<id>[1-9]\d*)' => 'PhabricatorSlowvotePollController',
'/vote/' => array(
'(?:view/(?P<view>\w+)/)?' => 'PhabricatorSlowvoteListController',
'create/' => 'PhabricatorSlowvoteCreateController',
@@ -42,15 +42,15 @@ public function getRoutes() {
return array(
'/xhpast/' => array(
'' => 'PhabricatorXHPASTViewRunController',
- 'view/(?P<id>\d+)/'
+ 'view/(?P<id>[1-9]\d*)/'
=> 'PhabricatorXHPASTViewFrameController',
- 'frameset/(?P<id>\d+)/'
+ 'frameset/(?P<id>[1-9]\d*)/'
=> 'PhabricatorXHPASTViewFramesetController',
- 'input/(?P<id>\d+)/'
+ 'input/(?P<id>[1-9]\d*)/'
=> 'PhabricatorXHPASTViewInputController',
- 'tree/(?P<id>\d+)/'
+ 'tree/(?P<id>[1-9]\d*)/'
=> 'PhabricatorXHPASTViewTreeController',
- 'stream/(?P<id>\d+)/'
+ 'stream/(?P<id>[1-9]\d*)/'
=> 'PhabricatorXHPASTViewStreamController',
),
);

0 comments on commit 22cb8f5

Please sign in to comment.