r13738 - in Products.Archetypes/trunk: . Products/Archetypes/skins/archetypes/widgets

"Vincent Fretin" <[email protected]> Fri, 22 Jul 2011 15:06:14 +0000
Newsgroups gmane.comp.web.zope.plone.archetypes.cvs
Message-ID <[email protected]>
Author: vincentfretin
Date: Fri Jul 22 15:06:13 2011
New Revision: 13738

Modified:
   Products.Archetypes/trunk/CHANGES.txt
   Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/textarea.pt
Log:
Fixed initial content length used by textCounter. Length should be the length of a unicode string, not the utf-8 string.

Modified: Products.Archetypes/trunk/CHANGES.txt
==============================================================================
--- Products.Archetypes/trunk/CHANGES.txt	(original)
+++ Products.Archetypes/trunk/CHANGES.txt	Fri Jul 22 15:06:13 2011
@@ -4,7 +4,9 @@
 1.7.7 - Unreleased
 ------------------
 
-- Nothing changed yet.
+- Fixed initial content length used by textCounter. Length should be the length
+  of a unicode string, not the utf-8 string.
+  [vincentfretin]
 
 
 1.7.6 - 2011-05-21

Modified: Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/textarea.pt
==============================================================================
--- Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/textarea.pt	(original)
+++ Products.Archetypes/trunk/Products/Archetypes/skins/archetypes/widgets/textarea.pt	Fri Jul 22 15:06:13 2011
@@ -29,7 +29,7 @@
                   binary python:base and value.isBinary() or context.isBinary(fieldName);
                   content python: not not base and value.getRaw() or value;
                   content python: not binary and content or '';
-                  content_length python:len(content);
+                  content_length python:len(unicode(content, 'utf-8'));
                   append_only widget/append_only|nothing;
                   maxlength widget/maxlength|nothing;
                   tcname string:textCounter_${fieldName};

------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/