Revision: 1166
          http://stripes.svn.sourceforge.net/stripes/?rev=1166&view=rev
Author:   bengunter
Date:     2009-10-16 17:51:21 +0000 (Fri, 16 Oct 2009)

Log Message:
-----------
Fixed STS-685: The field-metadata tag can produce Javascript with errors from 
the "mask" property of @Validate. Instead of messing with the slashes, I 
changed the Javascript to use new RegExp(".."). This allows use of 
JavascriptBuilder.quote(..) to take care of quoting the regexp as a string.

Modified Paths:
--------------
    branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java

Modified: 
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java
===================================================================
--- 
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java    
    2009-10-16 17:25:57 UTC (rev 1165)
+++ 
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java    
    2009-10-16 17:51:21 UTC (rev 1166)
@@ -180,7 +180,9 @@
                             data.trim());
                 if (data.mask() != null)
                     fieldInfo.append(fieldInfo.length() > 0 ? "," : 
"").append("mask:")
-                            .append("/^").append(data.mask()).append("$/");
+                            .append("new RegExp(")
+                            .append(JavaScriptBuilder.quote("^" + 
data.mask().toString() + "$"))
+                            .append(")");
                 if (data.minlength() != null)
                     fieldInfo.append(fieldInfo.length() > 0 ? "," : 
"").append("minlength:")
                             .append(data.minlength());


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to