mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Exclude unintended char from being captured
This commit is contained in:
parent
30e1e7a98f
commit
84a8eedad4
@ -78,7 +78,7 @@
|
||||
match = matches[++k];
|
||||
q = props[p];
|
||||
// check if given property is actually array
|
||||
if (typeof(q) === OBJ_TYPE) {
|
||||
if (typeof(q) === OBJ_TYPE && q.length > 0) {
|
||||
if (q.length == 2) {
|
||||
// assign given value, ignore regex match
|
||||
result[q[0]] = q[1];
|
||||
@ -306,7 +306,7 @@
|
||||
|
||||
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
|
||||
/(zte)-(\w+)*/i, // ZTE
|
||||
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|;\ssony)[_\s-]?([\w-]+)*/i
|
||||
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i
|
||||
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
|
||||
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user