diff options
author | James Moger <james.moger@gitblit.com> | 2013-09-19 09:03:04 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-09-19 09:03:04 -0400 |
commit | 2a8ea034b63736708839c140e53121026c19b9a8 (patch) | |
tree | 2efb5177f527de2c3ea259e9294de81debe9877b /src | |
parent | cbe6840efecf87e53a687cdce6fbdf84c6ab8a46 (diff) | |
download | gitblit-2a8ea034b63736708839c140e53121026c19b9a8.tar.gz gitblit-2a8ea034b63736708839c140e53121026c19b9a8.zip |
Fix support for implied SSH urls in web.otherUrls (issue-311)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java index aaab2b1c..0dae3cf1 100644 --- a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java @@ -365,7 +365,15 @@ public class RepositoryUrlPanel extends BasePanel { if (!urlPermissionsMap.containsKey(repoUrl.url)) {
String note;
if (repoUrl.isExternal()) {
- String protocol = repoUrl.url.substring(0, repoUrl.url.indexOf("://"));
+ String protocol;
+ int protocolIndex = repoUrl.url.indexOf("://");
+ if (protocolIndex > -1) {
+ // explicit protocol specified
+ protocol = repoUrl.url.substring(0, protocolIndex);
+ } else {
+ // implicit SSH url
+ protocol = "ssh";
+ }
note = MessageFormat.format(getString("gb.externalPermissions"), protocol);
} else {
note = null;
|