提交 022544dc 编写于 作者: K Kohsuke Kawaguchi

[FIXED JENKINS-12945] absolutize links in the context menu

Absolutizing on the server side is easier and more compact.
上级 6c5a9fc9
......@@ -55,6 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Some of the context menu items have wrong links
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12945">issue 12945</a>)
<li class=rfe>
Performance improvement in JavaScript on modern browsers
(<a href="https://github.com/jenkinsci/jenkins/pull/276">pull 276</a>)
......
......@@ -24,6 +24,7 @@ import org.xml.sax.helpers.DefaultHandler;
import javax.servlet.ServletException;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
......@@ -163,7 +164,7 @@ public interface ModelObjectWithContextMenu extends ModelObject {
public String icon;
public MenuItem(String url, String icon, String displayName) {
this.url = url;
this.url = URI.create(Stapler.getCurrentRequest().getRequestURI()).resolve(url).toString();
this.icon = icon;
this.displayName = Util.escape(displayName);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册