Author: jacopoc
Date: Mon Feb 16 06:50:41 2015
New Revision: 1660031
URL:
http://svn.apache.org/r1660031Log:
Applied patch contributed by Gareth Carter in OFBIZ-5910: it is a fix for a bug introduced by the fix for OFBIZ-3382.
The issue reported in OFBIZ-3382 and the fix committed for it need to be reviewed and possibly reworked but in the meantime this fix will solve the problem with broken links reported recently.
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=1660031&r1=1660030&r2=1660031&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Mon Feb 16 06:50:41 2015
@@ -28,6 +28,7 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.lang.StringEscapeUtils;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilCodec;
import org.ofbiz.base.util.UtilGenerics;
@@ -50,11 +51,12 @@ public final class WidgetWorker {
public static void buildHyperlinkUrl(Appendable externalWriter, String target, String targetType, Map<String, String> parameterMap,
String prefix, boolean fullPath, boolean secure, boolean encode, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) throws IOException {
- String localRequestName = UtilHttp.encodeAmpersands(target);
// We may get an encoded request like: /projectmgr/control/EditTaskContents?workEffortId=10003
// Try to reducing a possibly encoded string down to its simplest form: /projectmgr/control/EditTaskContents?workEffortId=10003
// This step make sure the following appending externalLoginKey operation to work correctly
- localRequestName = UtilCodec.canonicalize(localRequestName);
+ String localRequestName = StringEscapeUtils.unescapeHtml(target);
+ localRequestName = UtilHttp.encodeAmpersands(localRequestName);
+
Appendable localWriter = new StringWriter();
if ("intra-app".equals(targetType)) {