mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Only allow string for setUA()
This commit is contained in:
parent
4c77c5ef21
commit
a74ebeb82e
@ -1147,7 +1147,8 @@
|
||||
['getResult', createItemFunc(UA_RESULT)],
|
||||
['getUA', function () { return userAgent; }],
|
||||
['setUA', function (ua) {
|
||||
userAgent = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? trim(ua, UA_MAX_LENGTH) : ua;
|
||||
if (typeof ua === STR_TYPE)
|
||||
userAgent = ua.length > UA_MAX_LENGTH ? trim(ua, UA_MAX_LENGTH) : ua;
|
||||
return this;
|
||||
}]
|
||||
])
|
||||
|
Loading…
x
Reference in New Issue
Block a user