summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/utils.js')
-rw-r--r--lib/handlebars/utils.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js
index 85c1a94..7d9da17 100644
--- a/lib/handlebars/utils.js
+++ b/lib/handlebars/utils.js
@@ -47,6 +47,11 @@ Handlebars.Utils = {
return "";
}
+ // Force a string conversion as this will be done by the append regardless and
+ // the regex test will do this transparently behind the scenes, causing issues if
+ // an object's to string has escaped characters in it.
+ string = string.toString();
+
if(!possible.test(string)) { return string; }
return string.replace(badChars, escapeChar);
},