When checking the USER_AGENT, stripos must be used with a strict comparaison in case User agent start with the search word for example :
case (stripos($user_agent, 'blackberry') !== FALSE);
Who doesn't match this user agent : BlackBerry9530/4.7.0.167 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102 UP.Link/6.3.1.20.0

CommentFileSizeAuthor
#1 1948082.patch2.4 KBjducro

Comments

jducro’s picture

StatusFileSize
new2.4 KB

Here's a patch fixing it

jducro’s picture

Status: Active » Needs review
xen’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This made device detection fail on a site where we have Varnish rewrite the user-agent down to a simple set ("iPhone", "Mozilla", etc.) to improve caching opportunities. This patch fixes the problem.