portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1716302 - /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/content/DynamicWebContentRewriter.java
Date Wed, 25 Nov 2015 04:42:37 GMT
Author: taylor
Date: Wed Nov 25 04:42:36 2015
New Revision: 1716302

URL: http://svn.apache.org/viewvc?rev=1716302&view=rev
Log:
JS2-1347: NPE in dynamic web content rewriter (DPSML)

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/content/DynamicWebContentRewriter.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/content/DynamicWebContentRewriter.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/content/DynamicWebContentRewriter.java?rev=1716302&r1=1716301&r2=1716302&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/content/DynamicWebContentRewriter.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/content/DynamicWebContentRewriter.java
Wed Nov 25 04:42:36 2015
@@ -16,16 +16,15 @@
  */
 package org.apache.jetspeed.portlets.content;
 
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.portlet.PortletURL;
-
 import org.apache.portals.applications.webcontent2.portlet.rewriter.MutableAttributes;
 import org.apache.portals.applications.webcontent2.portlet.rewriter.WebContentRewriter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.portlet.PortletURL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 /**
  * WebContentRewriter that overlays page navigation onto portal content paths.
  * 
@@ -236,7 +235,8 @@ public class DynamicWebContentRewriter e
             // compute relative url from root relative url
             String baseRootUrl = baseRootURL(getBaseUrl());
             url = url.substring(1);
-            String remainingBasePath = baseUrl.substring(baseRootUrl.length());
+            int length = baseRootUrl.length();
+            String remainingBasePath = (length >= baseUrl.length()) ? "" : baseUrl.substring(length);
             int remainingBasePathIndex = remainingBasePath.indexOf('/');
             while (remainingBasePathIndex != -1)
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message