Author: jleroux
Date: Thu Mar 11 00:20:57 2010
New Revision: 921643

URL: http://svn.apache.org/viewvc?rev=921643&view=rev
Log:
Following r921421, here is the right and simplest solution (KISS way).
Simply encoding the tooltip (why I did not think about that before, really 
sometimes I wonder how my brain is working, I need to stop working for it to 
begin to work)
There are no needs to encode char like >, but of course < is needed (in he XML 
file) since else there is a problem in the XML labels file (always the same 
issue: around vs inside)
So yes, it's only a matter of encoding at the right place, ie before the 
"around vs inside" issue arises
Good night ;)

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java
    ofbiz/trunk/framework/example/config/ExampleUiLabels.xml
    
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java?rev=921643&r1=921642&r2=921643&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java Thu Mar 11 
00:20:57 2010
@@ -874,6 +874,10 @@ public class UtilHttp {
         return htmlString.replaceAll(" ", "%20");
     }
 
+    public static String encodeQuotes(String htmlString) {
+        return htmlString.replaceAll("\"", "\\\\\"");
+    }
+
     public static String setResponseBrowserProxyNoCache(HttpServletRequest 
request, HttpServletResponse response) {
         setResponseBrowserProxyNoCache(response);
         return "success";

Modified: ofbiz/trunk/framework/example/config/ExampleUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/config/ExampleUiLabels.xml?rev=921643&r1=921642&r2=921643&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/config/ExampleUiLabels.xml (original)
+++ ofbiz/trunk/framework/example/config/ExampleUiLabels.xml Thu Mar 11 
00:20:57 2010
@@ -97,7 +97,7 @@
     </property>
     <property key="ExampleDateField10Tooltip">
         <value xml:lang="en">Same as above, uses the nowTimestamp variable 
(always available in the form context) to set the default value to now</value>
-        <value xml:lang="fr">La même chose mais la variable nowTimestamp 
(toujours disponible dans context) est utilisée pour affecter la valeur par 
défaut à 'maintenant'</value>
+        <value xml:lang="fr">La même chose mais la variable nowTimestamp 
(toujours disponible dans context) est utilisée pour affecter la valeur par 
défaut à "maintenant"</value>
         <value xml:lang="it">Lo stesso di sopra, usare la variabile 
nowTimestamp (sempre disponibile nel contesto della form) per impostare il 
valore di default ad adesso</value>
         <value 
xml:lang="zh">同上,使用nowTimstamp变量(在表单中总是可用的)来把缺省值设置为现在</value>
     </property>

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=921643&r1=921642&r2=921643&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 Mar 11 00:20:57 2010
@@ -2762,7 +2762,7 @@ public class MacroFormRenderer implement
         StringWriter sr = new StringWriter();
         sr.append("<@renderTooltip ");
         sr.append("tooltip=\"");
-        sr.append(tooltip);
+        sr.append(UtilHttp.encodeQuotes(tooltip));
         sr.append("\" tooltipStyle=\"");
         sr.append(modelFormField.getTooltipStyle());
         sr.append("\" />");


Reply via email to