From 910b3dae95e0746ae8518eea07a7ae1fb6e7a819 Mon Sep 17 00:00:00 2001 From: dwdyer Date: Tue, 13 May 2008 19:01:39 +0000 Subject: [PATCH] Fix for incorrect test result links when project name contains spaces (ISSUE#1666). git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9224 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Util.java | 5 +++++ core/src/main/java/hudson/model/AbstractItem.java | 2 +- .../hudson/tasks/test/AbstractTestResultAction/summary.jelly | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index 971b689578..ba25ae8317 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -733,7 +733,12 @@ public class Util { * but don't remember it right now. * * @since 1.204 + * @deprecated This method is broken (see ISSUE#1666). It should probably + * be removed but I'm not sure if it is considered part of the public API + * that needs to be maintained for backwards compatibility. + * Use {@link #encode(String)} instead. */ + @Deprecated public static String encodeRFC2396(String url) { try { return new URI(null,url,null).toASCIIString(); diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java index 12897871bb..8a9af12144 100644 --- a/core/src/main/java/hudson/model/AbstractItem.java +++ b/core/src/main/java/hudson/model/AbstractItem.java @@ -150,7 +150,7 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet StaplerRequest request = Stapler.getCurrentRequest(); if(request==null) throw new IllegalStateException("Not processing a HTTP request"); - return Util.encodeRFC2396(request.getRootPath()+'/'+getUrl()); + return Util.encode(request.getRootPath()+'/'+getUrl()); } /** diff --git a/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly b/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly index b1a3cf35a7..acc11135e2 100644 --- a/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly +++ b/core/src/main/resources/hudson/tasks/test/AbstractTestResultAction/summary.jelly @@ -38,7 +38,7 @@
  • - + ${testObject.fullName}