From 384897521d636f98e84c7f7a7fec245c7f757d8a Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 11 Apr 2009 16:13:29 -0600 Subject: [PATCH] Catch invalid addresses --- imp/js/src/DimpBase.js | 6 ++++-- imp/lib/DIMP.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index c84502983..ed0c1ad13 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -458,8 +458,10 @@ var DimpBase = { 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 null, invalid string was scrubbed by JSON encode. + if (row.from === null) { + row.from = '[' + DIMP.text.badaddr + ']'; + } if (row.subject === null) { row.subject = '[' + DIMP.text.badsubject + ']'; } diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index 0eb7ba5e9..7b11cd2fa 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -244,6 +244,7 @@ class DIMP 'check' => _("Checking..."), 'verify' => _("Verifying..."), 'onlogout' => _("Logging Out..."), + 'badaddr' => _("Invalid Address"), '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."), -- 2.11.0