[imp] imp-3.2.2 messes up from addresses

Peter Solodov peter at alcor.concordia.ca
Wed Sep 17 09:42:12 PDT 2003


On 16 Sep 2003, Peter Solodov wrote:
> It still happens when addresses are inserted from address book,
> didn't find where that happens yet.

OK, found that one too.  See appended diff.

Is anybody going to fix that in CVS?

        - Peter

-- 
Peter Solodov                    | Concordia University 
http://alcor.concordia.ca/~peter | Montreal, QC, Canada

--- imp-3.2.2/templates/contacts/javascript.inc.original        2002-09-12 19:45:02.000000000 -0400
+++ imp-3.2.2/templates/contacts/javascript.inc 2003-09-17 12:35:12.000000000 -0400
@@ -95,6 +95,23 @@
         var field   = null;
 
         fullname = fullname.substring(pos + 2, fullname.length);
+
+        // 2003/09/17 Peter Solodov: yet another escape fix
+
+        var start = 0;
+        var end   = fullname.length
+
+        if (fullname[0] == '"')
+        {
+            start = 1;
+        }
+        if (fullname[fullname.length - 1] == '"')
+        {
+            end = fullname.length - 1;
+        }
+
+        fullname = fullname.substring(start, end);
+        
         fullname = fullname.replace(/\\/g, '\\\\');
         fullname = fullname.replace(/"/g, '\\"');
         if (address.substring(pos + 2, address.length).indexOf(",") > 0) {


More information about the imp mailing list