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
This commit is contained in:
scott%scott-macgregor.org
2004-11-15 23:29:33 +00:00
parent 66b0b87f3c
commit c6ee9a39cf
2 changed files with 7 additions and 1 deletions

View File

@@ -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. &amp; becomes '&'
this.title = this.title.replace(/&lt;/g, '<');
this.title = this.title.replace(/&gt;/g, '>');
this.title = this.title.replace(/&amp;/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);

View File

@@ -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'); }