serbanghita / Mobile-Detect

Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

Home Page:http://mobiledetect.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Samsung Tablets no longer detected

ForsakenNGS opened this issue · comments

Issue description
Since a few days ago Samsung Tablets are no longer detected properly. It seems they removed the model number from the user-agent as seen below. The tablet tested here is a Samsung Tab S7+.

User-Agent(s)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Suggestions
As a workaround I appended |Android.*Chrome/[.0-9]* Safari/[.0-9]* to the GenericTablet rule, which classifies all android devices sending e.g. Chrome/112.0.0.0 Safari/537.36 instead of Chrome/112.0.0.0 Mobile Safari/537.36 (no Mobile) as a tablet. I don't know if there are devices or edge-cases which this will break, but it is the only workaround I could figure out.

@ForsakenNGS
Same with unknown (brand new tablets) until they added weeks or month later to the project.

Just add this to the end of your GenericTablet section: |^(?!.*Mobile).*Android.*$
This will make every "Android" device which does not have "Mobile" in its UA-string to a tablet.

Same Motorola. It only displays Android 10 K

Can you tell how this one is still functioning: https://www.deviceinfo.me/

@serbanghita