From 3b441d2942b200e7d7123c64de818783be92917b Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 30 Jun 2012 19:58:53 +0200 Subject: [PATCH] Encode html entities in log --- couchpotato/core/plugins/log/static/log.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/couchpotato/core/plugins/log/static/log.js b/couchpotato/core/plugins/log/static/log.js index 7a91d4cf..0e276b58 100644 --- a/couchpotato/core/plugins/log/static/log.js +++ b/couchpotato/core/plugins/log/static/log.js @@ -78,15 +78,16 @@ Page.Log = new Class({ addColors: function(text){ var self = this; - var text = new Element('div', { - 'html': text - }).get('text') - - text = text.replace(/\u001b\[31m/gi, '') - text = text.replace(/\u001b\[36m/gi, '') - text = text.replace(/\u001b\[33m/gi, '') - text = text.replace(/\u001b\[0m\n/gi, '') - text = text.replace(/\u001b\[0m/gi, '') + text = text + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/\u001b\[31m/gi, '') + .replace(/\u001b\[36m/gi, '') + .replace(/\u001b\[33m/gi, '') + .replace(/\u001b\[0m\n/gi, '') + .replace(/\u001b\[0m/gi, '') return '' + text + ''; }