From c6ee9a39cf8f583d7cd9efb8e112faba6e9eb500 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Mon, 15 Nov 2004 23:29:33 +0000 Subject: [PATCH] Bug #268430 --> RSS feed doesn't correctly show HTML special chars in virtual Subject column use reg expressions to replace html entities like &, > and < into their ascii equivalents. sr=bienvenu git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@165377 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mail/extensions/newsblog/content/FeedItem.js | 6 ++++++ mozilla/mail/extensions/newsblog/content/utils.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/mail/extensions/newsblog/content/FeedItem.js b/mozilla/mail/extensions/newsblog/content/FeedItem.js index b6929c41ca1..6558750b7f8 100755 --- a/mozilla/mail/extensions/newsblog/content/FeedItem.js +++ b/mozilla/mail/extensions/newsblog/content/FeedItem.js @@ -303,6 +303,12 @@ FeedItem.prototype.writeToFolder = function() { if (this.author && this.author.indexOf('@') == -1) this.author = '<' + this.author + '>'; + // the subject may contain HTML entities. + // Convert these to their unencoded state. i.e. & becomes '&' + this.title = this.title.replace(/</g, '<'); + this.title = this.title.replace(/>/g, '>'); + this.title = this.title.replace(/&/g, '&'); + // Compress white space in the subject to make it look better. this.title = this.title.replace(/[\t\r\n]+/g, " "); this.title = this.mimeEncodeSubject(this.title, this.characterSet); diff --git a/mozilla/mail/extensions/newsblog/content/utils.js b/mozilla/mail/extensions/newsblog/content/utils.js index 15c79b950fe..d4eaa98fab5 100755 --- a/mozilla/mail/extensions/newsblog/content/utils.js +++ b/mozilla/mail/extensions/newsblog/content/utils.js @@ -1,7 +1,7 @@ // XXX Rename this to global.js // Whether or not to dump debugging messages to the console. -const DEBUG = true; +const DEBUG = false; var debug; if (DEBUG) debug = function(msg) { dump(' -- FZ -- : ' + msg + '\n'); }