提交 ebc21c65 编写于 作者: K kohsuke

escape URL unsafe names.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4854 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3d0793dd
......@@ -37,8 +37,8 @@ public final class CaseResult extends TestObject implements Comparable<CaseResul
// cn = parent.getName();
String cn = parent.getName();
className = cn.replace('/','_'); // avoid unsafe chars
testName = testCase.attributeValue("name").replace('/','_');
className = safe(cn);
testName = safe(testCase.attributeValue("name"));
errorStackTrace = getError(testCase);
}
......
......@@ -42,7 +42,7 @@ public final class SuiteResult implements Serializable {
// some user reported that name is null in their environment.
// see http://www.nabble.com/Unexpected-Null-Pointer-Exception-in-Hudson-1.131-tf4314802.html
name = '('+xmlReport.getName()+')';
this.name = name;
this.name = TestObject.safe(name);
stdout = root.elementText("system-out");
stderr = root.elementText("system-err");
......
......@@ -20,4 +20,11 @@ public abstract class TestObject implements ModelObject, Serializable {
* if no such counter part exists.
*/
public abstract TestObject getPreviousResult();
/**
* Replaces URL-unasfe characters.
*/
protected static String safe(String s) {
return s.replace('/','_').replace(':','_');
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册