svn commit: r816051 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r816051 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

jacopoc
Author: jacopoc
Date: Thu Sep 17 05:01:42 2009
New Revision: 816051

URL: http://svn.apache.org/viewvc?rev=816051&view=rev
Log:
Escaping characters to prevent issues with fields containing quotes etc.
Thanks to Marco Risaliti for the bug report.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=816051&r1=816050&r2=816051&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Thu Sep 17 05:01:42 2009
@@ -339,6 +339,12 @@
         }
 
         String value = modelFormField.getEntry(context, textField.getDefaultValue(context));
+        if (UtilValidate.isNotEmpty(value)) {
+            StringUtil.SimpleEncoder encoder = (StringUtil.SimpleEncoder)context.get("simpleEncoder");
+            if (encoder != null) {
+                value = encoder.encode(value);
+            }
+        }
         String textSize = Integer.toString(textField.getSize());
         String maxlength = "";
         if (textField.getMaxlength() != null) {