summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/utils.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-04-06 14:46:04 -0500
committerkpdecker <kpdecker@gmail.com>2013-04-06 14:46:04 -0500
commit671c07e6992d3094f3c06f2552fe1ab414ddec44 (patch)
treecd9ebf1658d4f94ff65a02470393e2064825287f /lib/handlebars/utils.js
parentf4d0092bb836f2c12ddf42dfe6be8e16778ffea5 (diff)
downloadhandlebars.js-671c07e6992d3094f3c06f2552fe1ab414ddec44.zip
handlebars.js-671c07e6992d3094f3c06f2552fe1ab414ddec44.tar.gz
handlebars.js-671c07e6992d3094f3c06f2552fe1ab414ddec44.tar.bz2
Force toString in escapeExpression
Fixes #211
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);
},