From 60b103435a62b561d8f1507edd5fc155a0e3d224 Mon Sep 17 00:00:00 2001 From: Tom Hunkapiller Date: Tue, 6 Sep 2016 23:44:08 -0500 Subject: [PATCH] fix autoescape for array values; fixes #835 --- src/runtime.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime.js b/src/runtime.js index 32d721a1..621dbfcb 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -206,8 +206,8 @@ function markSafe(val) { function suppressValue(val, autoescape) { val = (val !== undefined && val !== null) ? val : ''; - if(autoescape && typeof val === 'string') { - val = lib.escape(val); + if(autoescape && typeof val === 'string' || lib.isArray(val)) { + val = lib.escape(''+val); } return val;