Author: jleroux
Date: Fri Mar 23 06:27:43 2012
New Revision: 1304202
URL:
http://svn.apache.org/viewvc?rev=1304202&view=revLog:
"Applied fix from trunk for revision: 1304200 "
------------------------------------------------------------------------
r1304200 | jleroux | 2012-03-23 07:26:22 +0100 (ven., 23 mars 2012) | 15 lines
A patch from Kiran Gawde "StringIndexOutOfBoundsException in OfbizContentTransform"
https://issues.apache.org/jira/browse/OFBIZ-4464Fixes this bug:
---- exception report ----------------------------------------------------------
Error in request handler:
Exception: org.ofbiz.widget.screen.ScreenRenderException
Message: Error rendering screen component://ecommerce/widget/CommonScreens.xml#main-decorator: java.lang.StringIndexOutOfBoundsException: String index out of range: 0 (String index out of range: 0)
---- cause ---------------------------------------------------------------------
Exception: java.lang.StringIndexOutOfBoundsException
Message: String index out of range: 0
---- stack trace ---------------------------------------------------------------
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
java.lang.String.charAt(String.java:686)
org.ofbiz.webapp.ftl.OfbizContentTransform$1.close(OfbizContentTransform.java:97)
------------------------------------------------------------------------
Modified:
ofbiz/branches/release11.04/ (props changed)
ofbiz/branches/release11.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java
Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1304200
Modified: ofbiz/branches/release11.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java?rev=1304202&r1=1304201&r2=1304202&view=diff==============================================================================
--- ofbiz/branches/release11.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java (original)
+++ ofbiz/branches/release11.04/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizContentTransform.java Fri Mar 23 06:27:43 2012
@@ -94,7 +94,8 @@ public class OfbizContentTransform imple
// make the link
StringBuilder newURL = new StringBuilder();
ContentUrlTag.appendContentPrefix(request, newURL);
- if (newURL.length() > 0 && newURL.charAt(newURL.length() - 1) != '/' && requestUrl.charAt(0) != '/') {
+ if ((newURL.length() > 0 && newURL.charAt(newURL.length() - 1) != '/')
+ && (requestUrl.length()> 0 && requestUrl.charAt(0) != '/')) {
newURL.append('/');
}