From bdb968d3afaaf19015f6e96af40fd3a47ee76450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 8 Jun 2015 22:19:11 +0200 Subject: [PATCH] More strict escaping Thanks, @nathan0! Fixes #622 --- index.html | 2 +- js/filters.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 4e710f9..0a71a8f 100644 --- a/index.html +++ b/index.html @@ -284,7 +284,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel <>
+ --> diff --git a/js/filters.js b/js/filters.js index 6fe60e4..d2b0d96 100644 --- a/js/filters.js +++ b/js/filters.js @@ -141,6 +141,18 @@ weechat.filter('getBufferQuickKeys', function () { }; }); +weechat.filter('escape', ['$sanitize', function($sanitize) { + return function(text) { + // manual escaping because ng-sanitize is shit + return text + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + }; +}]); + // Emojifis the string using https://github.com/Ranks/emojione weechat.filter('emojify', function() { return function(text, enable_JS_Emoji) {