From: maks feltrin Date: Fri, 21 Oct 2016 20:34:54 +0000 (+0200) Subject: parseValue() full match with string literals X-Git-Tag: v6.3-rc1~26^2~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df88faf12bdacec57e81ec8b5f1ebfe8cf6efb83;p=thirdparty%2Ffoundation%2Ffoundation-sites.git parseValue() full match with string literals the original regex matching would have made values like "untrue" to be interpreted as `true` and values like "not-false" as `false` see https://github.com/zurb/foundation-sites/pull/9149 --- diff --git a/js/foundation.core.js b/js/foundation.core.js index c3430a1dc..50228e2f8 100644 --- a/js/foundation.core.js +++ b/js/foundation.core.js @@ -364,8 +364,8 @@ function functionName(fn) { } } function parseValue(str){ - if(/true/.test(str)) return true; - else if(/false/.test(str)) return false; + if('true' === str) return true; + else if('false' === str) return false; else if(!isNaN(str * 1)) return parseFloat(str); return str; }