diff --git a/package.json b/package.json index dd288de..31ab415 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "UA-Parser.JS", "name": "ua-parser-js", - "version": "0.4.3", + "version": "0.4.4", "author": "Faisal Salman (http://faisalman.com)", "description": "Lightweight JavaScript-based user-agent string parser", "keywords": [ diff --git a/ua-parser.js b/ua-parser.js index 4cf9ad0..82e5a9d 100644 --- a/ua-parser.js +++ b/ua-parser.js @@ -1,4 +1,4 @@ -// UA-Parser.JS v0.4.3 +// UA-Parser.JS v0.4.4 // Lightweight JavaScript-based User-Agent string parser // https://github.com/faisalman/ua-parser-js // @@ -45,7 +45,7 @@ if (typeof props[k] === 'object' && props[k].length === 2) { result[props[k][0]] = props[k][1]; } else if (typeof props[k] === 'object' && props[k].length === 3) { - if (typeof props[k][1] === 'function') { + if (typeof props[k][1] === 'function' && !(props[k][1].exec && props[k][1].test)) { result[props[k][0]] = m ? props[k][1].call(this, m, props[k][2]) : undefined; } else { result[props[k][0]] = m ? m.replace(props[k][1], props[k][2]) : undefined;