Browse Source

Fix .text considered reading when called with an empty string

Gaël Métais 10 years ago
parent
commit
c2db1c70e3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      front/src/js/directives/offendersDirectives.js

+ 2 - 2
front/src/js/directives/offendersDirectives.js

@@ -166,7 +166,7 @@
         
         
         // escape HTML in args
         // escape HTML in args
         for (var i = 0 ; i < 4 ; i ++) {
         for (var i = 0 ; i < 4 ; i ++) {
-            if (unescapedArgs[i]) {
+            if (unescapedArgs[i] !== undefined) {
                 args[i] = escapeHTML(unescapedArgs[i]);
                 args[i] = escapeHTML(unescapedArgs[i]);
             }
             }
         }
         }
@@ -254,7 +254,7 @@
                 return 'replace <b>' + args[0] + '</b> with ' + getJQueryContextButtonHTML(ctxt, onASingleLine);
                 return 'replace <b>' + args[0] + '</b> with ' + getJQueryContextButtonHTML(ctxt, onASingleLine);
 
 
             case 'jQuery - text':
             case 'jQuery - text':
-                if (args[0]) {
+                if (args[0] !== undefined) {
                     return 'set text "<b>' + args[0] + '</b>" to ' + getJQueryContextButtonHTML(ctxt, onASingleLine);
                     return 'set text "<b>' + args[0] + '</b>" to ' + getJQueryContextButtonHTML(ctxt, onASingleLine);
                 } else {
                 } else {
                     return 'get text from ' + getJQueryContextButtonHTML(ctxt, onASingleLine);
                     return 'get text from ' + getJQueryContextButtonHTML(ctxt, onASingleLine);