-
Notifications
You must be signed in to change notification settings - Fork 495
Detect new brand: Tone, AT&T, BIHEE, Ravoz and Detect old devices model for brands: Realme, Positivo BGH, Blackview , Wiko, Alcatel, Multilaser, Samsung, How, LG, Kyocera, Huawei, Oppo, HTC, Sony, Sharp, Google, Panasonic, ZTE, Coolpad #6333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… M7s Lite, H feat(device) detect brand Positivo BGH models: Twist 3, Twist Tab issue matomo-org#6330
feat(device) detect brand Blackview model: BV9900 feat(device) detect brand Wiko model: Ride (W-U300)
feat(device) detect brand Coolpad model: Legacy (cp3705AS) feat(device) detect brand Alcatel model: 3X (2019) (5048Y_EEA) feat(device) detect brand Wiko model: Life 2 (U307AS) feat(device) detect brand ZTE model: Blade Q+ (402ZT) feat(device) detect brand Sharp model: Aquos S3 (SH-02M) feat(device) detect brand Kyocera models: Gratina 4G (KYF31), Urbano V01 (KYV31)
… S9 (SC-02K), GALAXY S9+ (SC-03K), GALAXY S10 (SC-03L), GALAXY S10+ (SC-04L), GALAXY S20+ 5G (SC-52A), GALAXY A20 (SC-02M), GALAXY Note Edge (SC-01G), GALAXY Note 8 (SC-01K), GALAXY Note 9 (SC-01L) feat(device) detect brand Kyocera model: Qua Phone QZ (KYV44) feat(device) detect brand Huawei model: P9 Lite (VNS-L22)
…Feel (SC-04J) GALAXY Note 10+ (SC-01M), GALAXY S6 (SC-05G), GALAXY Active Neo (SC-01H) feat(device) detect brand Sharp models: Aquos Ever (SH-02J) feat(device) detect brand Kyocera model: Torque G04 (KYV46) feat(device) detect brand Oppo model: Reno A (CPH1983) fix(devices) fixed Samsung model names: GALAXY S6 edge (Edge in uppercase), GALAXY S7 active (Active in uppercase); fix(devices) renamed galaxy S6 edge (Softbank) for GALAXY S6 Edge
feat(device) detect brand Oppo model: A9 (2020) (CPH1941) feat(device) detect brand Kyocera models: Urbano V03 (KYV38), One S6 (S6-KC) feat(device) detect brand Sony models: Xperia 1 (802SO) feat(device) detect brand Huawei models: D Tab Compact (d-02H, d-02K), Nova 2 Lite (704HW) feat(device) detect brand Panasonic model: Eluga Live 10.1" (P-08D) feat(device) detect brand Sharp models: Aquos Ever (SH-04G), Aquos S3 (SHV45), Aquos Phone Zeta (SH-01G, SH-01H, SH-04H), Aquos R3 (SH-04L), Aquos R2 (SH-03K), Aquos S2 (SH-01K), Aquos Xx2 (502SH), Aquos L2 (SH-L02), Aquos R (SH-03J), Aquos Compact (SH-02H), Basio 2 (SHV36), One S5 (S5-SH) feat(device) detect brand Samsung model: GALAXY S20 5G (SCG01), GALAXY A20 (SCV46)
feat(device) detect brand Google model: Pixel 3a feat(device) detect brand LG model: G8X ThinQ (901LG) feat(device) detect brand Sony model: Xperia 10 II (A001SO) feat(device) detect brand Kyocera model: Gratina 4G (KYF39) feat(device) detect brand Sharp models: Aquos S2 (SH-01L), Aquos R (SHV39), Aquos R5G (SH-51A), Aquos R3 (SH-03G), One (507SH) feat(device) detect brand Samsung models: GALAXY S5 Active (SC-02G), GALAXY Note 10+ (SCV45), GALAXY Tab 4 7.0" 3G (403SC)
feat(device) detect brand SEMP TCL model: GO! 3C Plus feat(device) detect brand TCL model: C9 (5199I) feat(device) detect brand How model: HT-1001G Go Kids (1001-G Go) feat(device) detect brand Huawei model: Qua Tab 02 10.1" (HWT31) feat(device) detect brand Realme model: X3 Super Zoom (RMX2086) feat(device) detect brand ZTE models: Optus X Vista (Z6621O), Optus X Power 2 (P545), Blade A3 2019-T, Optus X Wave (P609) feat(device) detect brand Vivo model: V15(1819), feat(device) detect brand Multilaser models: MS60Z, MS45S, MS80X, MS5.V2, MS50S issue matomo-org#6330
# Conflicts: # Tests/fixtures/smartphone-15.yml # regexes/device/mobiles.yml
# Conflicts: # Tests/fixtures/smartphone-15.yml # regexes/device/mobiles.yml
feat(device) detect brand SEMP TCL model: GO! 3C (GO3C); feat(device) detect brand Positivo BGH model: Twist SE; issue matomo-org#6330
feat(device) detect brand Xiaomi model: MI 9T Pro;
feat(device) detect brand Meizu model: 15 Plus (MZ-15 Plus)
feat(device) detect brand Meizu model: 16X (MZ-16 X)
feat(device) detect brand Ledstar model: Novus Premium 6.0"
*/ | ||
protected function matchUserAgent($regex) | ||
{ | ||
// only match if useragent begins with given regex or there is no letter before it | ||
$regex = '/(?:^|[^A-Z0-9\-_]|[^A-Z0-9\-]_|sprd-)(?:' . str_replace('/', '\/', $regex) . ')/i'; | ||
|
||
if (preg_match($regex, $this->userAgent, $matches)) { | ||
return $matches; | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case can preg_match throw an exception? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the exception is when the regular expression is spelled incorrectly.
I added an exception to see which regular expression is incorrect when running tests
in this PR: