From 1e1843e44d4eb4e44ac8d752cf67987ef10da269 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 3 Apr 2009 14:09:11 -0600 Subject: [PATCH] New rendering code allows us to catch invalid subject headers in the mailbox list. --- imp/js/src/DimpBase.js | 6 ++++++ imp/lib/DIMP.php | 1 + 2 files changed, 7 insertions(+) diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 076a13d49..f9a0e6ce9 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -457,6 +457,12 @@ var DimpBase = { if (search == 'from' || search == 'subject') { row[search] = row[search].gsub(new RegExp("(" + $F('msgList_filter') + ")", "i"), '#{1}'); } + + // 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) { diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index 84de294aa..9a5f62191 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -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."), -- 2.11.0