Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 7fcda47

Browse files
committed
Fixed issue with windows phone and is mobile
1 parent 32a6a09 commit 7fcda47

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 6.0.5 (released 2016-07-28)
4+
5+
- Windows Phone now marks OS as mobile
6+
37
## 6.0.4 (released 2016-07-27)
48

59
- Fixed Windows Phone detection

src/OsDetector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ private static function checkWindows(Os $os, UserAgent $userAgent)
224224
private static function checkWindowsPhone(Os $os, UserAgent $userAgent)
225225
{
226226
if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) {
227+
$os->setIsMobile(true);
227228
$os->setName($os::WINDOWS_PHONE);
228229
// Windows version
229230
if (preg_match('/Windows Phone ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) {

tests/BrowserDetector/Tests/OsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function testBlackberry()
3939

4040
public function testIsMobile()
4141
{
42+
$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');
43+
$this->assertTrue($os->isMobile());
4244
$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');
4345
$this->assertTrue($os->isMobile());
4446
}

0 commit comments

Comments
 (0)