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:45 UTC

svn commit: r927676 - /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java

Author: ivaynberg
Date: Fri Mar 26 03:08:45 2010
New Revision: 927676

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

Modified:
    wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java

Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java?rev=927676&r1=927675&r2=927676&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java Fri Mar 26 03:08:45 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;
 	}