From 11ccd9c0571bd9fc8f138557dd4775ebb29d7644 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 16 Aug 2011 19:01:45 +0000 Subject: [PATCH] Check that value is a string before treating it as one --- etemplate/js/et2_common.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_common.js b/etemplate/js/et2_common.js index 72d3bd8685..0f345ae24b 100644 --- a/etemplate/js/et2_common.js +++ b/etemplate/js/et2_common.js @@ -129,10 +129,13 @@ function et2_checkType(_val, _type, _attr) return _val; } - var lcv = _val.toLowerCase(); - if (lcv === "true" || lcv === "false" || lcv === "") + if (typeof _val == "string") { - return _val === "true"; + var lcv = _val.toLowerCase(); + if (lcv === "true" || lcv === "false" || lcv === "") + { + return _val === "true"; + } } return _err();