From c2db1c70e318330321cf82e15e143612888e86a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Sat, 25 Apr 2015 18:02:48 +0200 Subject: [PATCH] Fix .text considered reading when called with an empty string --- front/src/js/directives/offendersDirectives.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/js/directives/offendersDirectives.js b/front/src/js/directives/offendersDirectives.js index 155f1fa..f226bb7 100644 --- a/front/src/js/directives/offendersDirectives.js +++ b/front/src/js/directives/offendersDirectives.js @@ -166,7 +166,7 @@ // escape HTML in args for (var i = 0 ; i < 4 ; i ++) { - if (unescapedArgs[i]) { + if (unescapedArgs[i] !== undefined) { args[i] = escapeHTML(unescapedArgs[i]); } } @@ -254,7 +254,7 @@ return 'replace ' + args[0] + ' with ' + getJQueryContextButtonHTML(ctxt, onASingleLine); case 'jQuery - text': - if (args[0]) { + if (args[0] !== undefined) { return 'set text "' + args[0] + '" to ' + getJQueryContextButtonHTML(ctxt, onASingleLine); } else { return 'get text from ' + getJQueryContextButtonHTML(ctxt, onASingleLine);