Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improves detection for Apple devices and Spotify #7525

Merged
merged 19 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DeviceDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,13 @@ protected function hasAndroidMobileFragment(): bool
}

/**
* Returns if the parsed UA contains the 'Desktop x64;' or 'Desktop x32;' or 'Desktop WOW64' fragment
* Returns if the parsed UA contains the 'Desktop;', 'Desktop x32;', 'Desktop x64;' or 'Desktop WOW64;' fragment
*
* @return bool
*/
protected function hasDesktopFragment(): bool
{
$regex = 'Desktop (x(?:32|64)|WOW64);';
$regex = 'Desktop(?: (x(?:32|64)|WOW64))?;';

return !!$this->matchUserAgent($regex);
}
Expand Down
6 changes: 6 additions & 0 deletions Tests/Parser/Client/fixtures/mobile_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1559,3 +1559,9 @@
type: mobile app
name: WeRead
version: 4.1.3
-
user_agent: Spotify/120800923 OSX/0 (MacBookPro6,2)
client:
type: mobile app
name: Spotify
version: "120800923"
Loading