You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2010/03/26 04:08:52 UTC

svn commit: r927677 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java

Author: ivaynberg
Date: Fri Mar 26 03:08:52 2010
New Revision: 927677

URL: http://svn.apache.org/viewvc?rev=927677&view=rev
Log:
WICKET-2802 StringIndexOutOfBoundsException in PortletServletRequestWrapper for some resource requests
Issue: WICKET-2802

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java?rev=927677&r1=927676&r2=927677&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java Fri Mar 26 03:08:52 2010
@@ -131,7 +131,10 @@ public class PortletServletRequestWrappe
 	{
 		this(context, proxiedSession, request, filterPath);
 
-		String pathInfo = requestURI.substring(contextPath.length() + filterPath.length());
+		// Liferay sometimes gives an incorrect requestURI
+		int pathInfoBegin = contextPath.length() + filterPath.length();
+		String pathInfo = pathInfoBegin >= requestURI.length() ? null
+			: requestURI.substring(pathInfoBegin);
 		this.pathInfo = pathInfo == null || pathInfo.length() < 2 ? null : pathInfo;
 	}