提交 982f02a4 编写于 作者: M mindless

[FIXED HUDSON-6960] Encode from parameter in login link, to fix redirect

after login when return URL has characters that need encoding.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@32884 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1eaa8a00
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Matthew R. Harrah
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
Matthew R. Harrah, Alan Harder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -22,4 +23,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<a style="color:inherit" href="${rootURL}/${app.securityRealm.loginUrl}?from=${if (request.session.attribute('from')!=null) request.session.getAttribute('from'); else if (request.getParameter('from')!=null) request.getParameter('from'); else if (request.requestURI=='/loginError' || request.requestURI=='/login') '/'; else request.requestURI;} "><b>${%login}</b></a>
\ No newline at end of file
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<j:invokeStatic var="from" className="java.net.URLEncoder" method="encode">
<j:arg value="${if (request.session.attribute('from')!=null) request.session.getAttribute('from'); else if (request.getParameter('from')!=null) request.getParameter('from'); else if (request.requestURI=='/loginError' || request.requestURI=='/login') '/'; else request.requestURI;}"/>
<j:arg value="UTF-8"/>
</j:invokeStatic>
<a style="color:inherit" href="${rootURL}/${app.securityRealm.loginUrl}?from=${from}"><b>${%login}</b></a>
</j:jelly>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册