summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/gitblit/client/EditRepositoryDialog.java3
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.java3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/com/gitblit/client/EditRepositoryDialog.java b/src/com/gitblit/client/EditRepositoryDialog.java
index f6a315be..77878cbb 100644
--- a/src/com/gitblit/client/EditRepositoryDialog.java
+++ b/src/com/gitblit/client/EditRepositoryDialog.java
@@ -389,6 +389,9 @@ public class EditRepositoryDialog extends JDialog {
error("Relative folder references (../) are prohibited.");
return false;
}
+ if (rname.endsWith("/")) {
+ rname = rname.substring(0, rname.length() - 1);
+ }
// confirm valid characters in repository name
Character c = StringUtils.findInvalidCharacter(rname);
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
index a6f6af05..0176249b 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -212,6 +212,9 @@ public class EditRepositoryPage extends RootSubPage {
if (repositoryModel.name.contains("/../")) {
error(getString("gb.illegalRelativeSlash"));
return;
+ }
+ if (repositoryModel.name.endsWith("/")) {
+ repositoryModel.name = repositoryModel.name.substring(0, repositoryModel.name.length() - 1);
}
// confirm valid characters in repository name