diff --git a/CHANGELOG.md b/CHANGELOG.md index 682c866..2162695 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 6.0.5 (released 2016-07-28) + +- Windows Phone now marks OS as mobile + ## 6.0.4 (released 2016-07-27) - Fixed Windows Phone detection diff --git a/src/OsDetector.php b/src/OsDetector.php index ca39eaf..a3ec849 100644 --- a/src/OsDetector.php +++ b/src/OsDetector.php @@ -224,6 +224,7 @@ private static function checkWindows(Os $os, UserAgent $userAgent) private static function checkWindowsPhone(Os $os, UserAgent $userAgent) { if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) { + $os->setIsMobile(true); $os->setName($os::WINDOWS_PHONE); // Windows version if (preg_match('/Windows Phone ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) { diff --git a/tests/BrowserDetector/Tests/OsTest.php b/tests/BrowserDetector/Tests/OsTest.php index 596350b..dda986d 100644 --- a/tests/BrowserDetector/Tests/OsTest.php +++ b/tests/BrowserDetector/Tests/OsTest.php @@ -39,6 +39,8 @@ public function testBlackberry() public function testIsMobile() { + $os = new Os('Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; Lumia 640 LTE) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Mobile Safari/537.36 Edge/14.14393'); + $this->assertTrue($os->isMobile()); $os = new Os('Mozilla/5.0 (iPod; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/28.0.1500.16 Mobile/10B329 Safari/8536.25'); $this->assertTrue($os->isMobile()); }