Skip to content

Commit d227737

Browse files
committed
Automatically decode %7E in repository names to ~ (issue-278)
1 parent 9d63b8a commit d227737

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

releases.moxie

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ r18: {
1313
security: ~
1414
fixes:
1515
- Gitblit-as-viewer with no repository urls failed to display summary page (issue 269)
16+
- Fixed incorrect tagger in the dashboard pages (issue-276)
17+
- Automatically decode %7E in repository names from git clients that encode ~ (issue-278)
1618
- Fixed missing model class dependencies in Gitblit Manager build
1719
- Fix for IE10 compatibility mode
1820
- Reset dashboard and activity commit cache on branch REWIND or DELETE
1921
- Fixed bug with adding new local users with external authentication
2022
- Fixed missing clone url on the empty repository page
21-
- Fixed incorrect tagger in the dashboard pages (issue-276)
2223
- Fixed Ubuntu service script for LSB compliance
2324
- Inserted "sleep 5" in Ubuntu & Centos bash script for service restart
2425
changes:

src/main/java/com/gitblit/GitBlit.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,10 @@ public Repository getRepository(String repositoryName) {
15571557
* @return repository or null
15581558
*/
15591559
public Repository getRepository(String repositoryName, boolean logError) {
1560+
// Decode url-encoded repository name (issue-278)
1561+
// http://stackoverflow.com/questions/17183110
1562+
repositoryName = repositoryName.replace("%7E", "~").replace("%7e", "~");
1563+
15601564
if (isCollectingGarbage(repositoryName)) {
15611565
logger.warn(MessageFormat.format("Rejecting request for {0}, busy collecting garbage!", repositoryName));
15621566
return null;
@@ -1656,6 +1660,10 @@ public RepositoryModel getRepositoryModel(UserModel user, String repositoryName)
16561660
* @return repository model or null
16571661
*/
16581662
public RepositoryModel getRepositoryModel(String repositoryName) {
1663+
// Decode url-encoded repository name (issue-278)
1664+
// http://stackoverflow.com/questions/17183110
1665+
repositoryName = repositoryName.replace("%7E", "~").replace("%7e", "~");
1666+
16591667
if (!repositoryListCache.containsKey(repositoryName)) {
16601668
RepositoryModel model = loadRepositoryModel(repositoryName);
16611669
if (model == null) {

0 commit comments

Comments
 (0)