mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Verify that SVN repository URI ends in a "/"
Summary: Everything breaks if this isn't true, and it's easy to get subtly wrong right now. There are other more magical ways we could do this (automatically add a "/" in this form or at runtime) but I think making it explicit is the easiest and most robust approach. See T67. Test Plan: Tried to save a URI without a trailing slash. Reviewed By: jungejason Reviewers: jungejason, tuomaspelkonen, aran CC: aran, jungejason Differential Revision: 305
This commit is contained in:
parent
c1d6014bcb
commit
c67a749036
1 changed files with 10 additions and 0 deletions
|
@ -258,10 +258,20 @@ class PhabricatorRepositoryEditController
|
||||||
if (!$repository->getDetail('remote-uri')) {
|
if (!$repository->getDetail('remote-uri')) {
|
||||||
$e_uri = 'Required';
|
$e_uri = 'Required';
|
||||||
$errors[] = "Repository URI is required.";
|
$errors[] = "Repository URI is required.";
|
||||||
|
} else if ($is_svn &&
|
||||||
|
!preg_match('@/$@', $repository->getDetail('remote-uri'))) {
|
||||||
|
|
||||||
|
$e_uri = 'Invalid';
|
||||||
|
$errors[] = 'Subversion Repository URI must end in a slash ("/").';
|
||||||
|
} else {
|
||||||
|
$e_uri = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$repository->getDetail('local-path')) {
|
if (!$repository->getDetail('local-path')) {
|
||||||
$e_path = 'Required';
|
$e_path = 'Required';
|
||||||
$errors[] = "Local path is required.";
|
$errors[] = "Local path is required.";
|
||||||
|
} else {
|
||||||
|
$e_path = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue