New rendering code allows us to catch invalid subject headers in the
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 3 Apr 2009 20:09:11 +0000 (14:09 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 3 Apr 2009 20:46:21 +0000 (14:46 -0600)
mailbox list.

imp/js/src/DimpBase.js
imp/lib/DIMP.php

index 076a13d..f9a0e6c 100644 (file)
@@ -457,6 +457,12 @@ var DimpBase = {
                 if (search == 'from' || search == 'subject') {
                     row[search] = row[search].gsub(new RegExp("(" + $F('msgList_filter') + ")", "i"), '<span class="searchMatch">#{1}</span>');
                 }
+
+                // Check status. If null, invalid string was scrubbed by the
+                // JSON encode.
+                if (row.subject === null) {
+                    row.subject = '[' + DIMP.text.badsubject + ']';
+                }
             }.bind(this),
             onContentComplete: function(rows) {
                 rows.each(function(row) {
index 84de294..9a5f621 100644 (file)
@@ -235,6 +235,7 @@ class DIMP
             'check' => _("Checking..."),
             'verify' => _("Verifying..."),
             'onlogout' => _("Logging Out..."),
+            'badsubject' => _("Invalid Subject"),
             'ajax_timeout' => _("There has been no contact with the remote server for several minutes. The server may be temporarily unavailable or network problems may be interrupting your session. You will not see any updates until the connection is restored."),
             'ajax_recover' => _("The connection to the remote server has been restored."),
             'listmsg_wait' => _("The server is still generating the message list."),