From a502d96a860456ec5e8c96761db70f7cabb74751 Mon Sep 17 00:00:00 2001 From: Paul Martin <paul@paulsputer.com> Date: Sat, 30 Apr 2016 04:19:14 -0400 Subject: [PATCH] Merge pull request #1073 from gitblit/1062-DocEditorUpdates --- src/main/java/com/gitblit/servlet/DownloadZipFilter.java | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gitblit/servlet/DownloadZipFilter.java b/src/main/java/com/gitblit/servlet/DownloadZipFilter.java index 13703a8..146f6d4 100644 --- a/src/main/java/com/gitblit/servlet/DownloadZipFilter.java +++ b/src/main/java/com/gitblit/servlet/DownloadZipFilter.java @@ -54,11 +54,14 @@ @Override protected String extractRepositoryName(String url) { int a = url.indexOf("r="); - String repository = url.substring(a + 2); - if (repository.indexOf('&') > -1) { - repository = repository.substring(0, repository.indexOf('&')); + if (a > -1) { + String repository = url.substring(a + 2); + if (repository.indexOf('&') > -1) { + repository = repository.substring(0, repository.indexOf('&')); + } + return repository; } - return repository; + return null; } /** @@ -78,7 +81,7 @@ * @return true if the filter allows repository creation */ @Override - protected boolean isCreationAllowed() { + protected boolean isCreationAllowed(String action) { return false; } @@ -87,10 +90,11 @@ * * @param repository * @param action + * @param method * @return true if the action may be performed */ @Override - protected boolean isActionAllowed(RepositoryModel repository, String action) { + protected boolean isActionAllowed(RepositoryModel repository, String action, String method) { return true; } @@ -99,10 +103,11 @@ * * @param repository * @param action + * @param method * @return true if authentication required */ @Override - protected boolean requiresAuthentication(RepositoryModel repository, String action) { + protected boolean requiresAuthentication(RepositoryModel repository, String action, String method) { return repository.accessRestriction.atLeast(AccessRestrictionType.VIEW); } -- Gitblit v1.9.1