Teach escape_html to return an empty string when given an
undefined value as input.
Previously: a macro being replaced with an undefined value
resulted in the macro itself remaining in the output.
Now: a macro being replaced with an undefined value will result
in an empty string in the output.
},
'escape_html' : function(data) {
- return data.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
+ if (data) {
+ return data.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
+ } else {
+ return '';
+ }
},
'simple' : function(msg,params) {