You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2020/02/15 12:24:14 UTC

[ofbiz-framework] branch trunk updated: Fixed: Add 'controlPath' attribute to 'ofbizUrl' freemarker macro (OFBIZ-11317)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 969f48b  Fixed: Add 'controlPath' attribute to 'ofbizUrl' freemarker macro (OFBIZ-11317)
969f48b is described below

commit 969f48b7c9f692b8a6f1c54e2b4ce6ae1392961b
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Sat Feb 15 13:24:09 2020 +0100

    Fixed: Add 'controlPath' attribute to 'ofbizUrl' freemarker macro
    (OFBIZ-11317)
    
    In some place, like at least themes/tomahawk/template/AppBarClose.ftl the CSRF
    token is not generated. Because in those places OfbizUrlTransform is used.
    
    An immediate solution is to add the CSRF token generation in OfbizUrlTransform
    class.
    
    A definitive solution is to complete OFBIZ-11229
    "Merge UrlRegexpTransform and OfbizUrlTransform classes"
---
 .../src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java
index 554a373..495b4cb 100644
--- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java
+++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java
@@ -98,6 +98,7 @@ public class OfbizUrlTransform implements TemplateTransformModel {
         final boolean secure = checkBooleanArg(args, "secure", false);
         final boolean encode = checkBooleanArg(args, "encode", true);
         final String webSiteId = convertToString(args.get("webSiteId"));
+        final String controlPath = convertToString(args.get("controlPath"));
 
         return new Writer(out) {
 
@@ -144,7 +145,8 @@ public class OfbizUrlTransform implements TemplateTransformModel {
                         HttpServletResponse response = FreeMarkerWorker.unwrap(env.getVariable("response"));
                         String requestUrl = buf.toString();
                         RequestHandler rh = RequestHandler.from(request);
-                        out.write(rh.makeLink(request, response, requestUrl, fullPath, secure, encode));
+                        String link = (rh.makeLink(request, response, requestUrl, fullPath, secure, encode, controlPath));
+                        out.write(link);
                     } else {
                         out.write(buf.toString());
                     }