This bug only relates to the PHP detection method, I was unable to get the browscap method working reliably.

I've noticed the module will identify any user agent containing "Windows" as a desktop browser, however mobile phones running Windows Phone 7.0/7.5 have User Agents that contain windows, information:

http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/intr...

I've added the following after the "windows" check as a quick and dirty proof of conecpt:

Line 147:
  if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows phone os') > 0) {
    $mobile_browser = 1;
  }

Which correctly identifies windows phone7 as mobile.

It's not really efficient as it sets $mobile_browser to 0 and then back to 1, but it's just to show what need to be checked.

Comments

chrisfree’s picture

I can confirm that in limited testing this works. Again, not ideal, but if you're in a bind and need this immediately, it works. I was simply testing this with a basic UA switcher in Chrome.

chrisfree’s picture

Status: Active » Needs review
StatusFileSize
new1.56 KB

Here is a patch that adds the code mentioned above, as well as cleans up a few code styling issues.

stanl3y’s picture

Hello,
how can i implement ur patch?

pvmchau’s picture

Version: 7.x-1.2 » 7.x-1.3-alpha2
Status: Needs review » Patch (to be ported)
StatusFileSize
new552 bytes

I tried #2, but it doesn't work for me. I changed a little bit and it's working well.

pvmchau’s picture

Assigned: Unassigned » pvmchau
Status: Patch (to be ported) » Needs review

  • RobLoach committed 0253174 on 7.x-1.x authored by pvmchau
    Issue #1809972 by chrisfree, pvmchau: Windows Phone 7 - PHP detection...