Check that value is a string before treating it as one

This commit is contained in:
Nathan Gray 2011-08-16 19:01:45 +00:00
parent df2869c07f
commit 11ccd9c057

View File

@ -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();