Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

KARAF-1731 Active trail detection is broken after upgrade to wicket 1.5

git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1373662 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 30e6e4b6c307e02869cfe05317515a42601f8b88 1 parent 32456b4
@splatch splatch authored
View
9 core/src/main/java/org/apache/karaf/webconsole/core/util/LinkUtils.java
@@ -20,6 +20,7 @@
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.protocol.http.RequestUtils;
import org.apache.wicket.request.cycle.RequestCycle;
/**
@@ -54,13 +55,13 @@
*/
public static boolean isActiveTrail(Link<?> link) {
if (link instanceof BookmarkablePageLink) {
+ RequestCycle requestCycle = RequestCycle.get();
+ String requestPath = requestCycle.getRequest().getUrl().toString();
Class<? extends Page> pageClass = ((BookmarkablePageLink<?>) link).getPageClass();
- RequestCycle requestCycle = RequestCycle.get();
- String linkPath = (requestCycle.urlFor(pageClass, null) + "").replace("../", "");
+ String linkPath = requestCycle.urlFor(pageClass, null).toString();
- String requestPath = requestCycle.getRequest().getUrl().toString();
- return requestPath.contains(linkPath);
+ return requestPath.contains(RequestUtils.toAbsolutePath(requestPath, linkPath));
}
return false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.