зеркало из https://github.com/mozilla/gecko-dev.git
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
This commit is contained in:
Родитель
6faa0371eb
Коммит
74cdc63f85
|
@ -307,6 +307,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 = mimeEncodeSubject(this.title, this.characterSet);
|
||||
|
|
|
@ -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'); }
|
||||
|
|
Загрузка…
Ссылка в новой задаче