Skip to content

Commit

Permalink
Merge pull request #225 from romainneutron/ensure-type
Browse files Browse the repository at this point in the history
Force casting the user agent to string type
  • Loading branch information
romainneutron authored May 11, 2020
2 parents fcd1acb + 1b9bb62 commit 14e5b20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 2.9.1
* Ensure passing the correct type to UAParser::parse

### 2.9.0 (2020-03-02)

* Symfony 5 compatibility added
Expand Down
2 changes: 1 addition & 1 deletion UserAgent/UAFamilyParser/UAFamilyParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public function __construct(Parser $parser)

public function getUaFamily($userAgent)
{
return strtolower($this->parser->parse($userAgent)->ua->family);
return strtolower($this->parser->parse((string) $userAgent)->ua->family);
}
}

0 comments on commit 14e5b20

Please sign in to comment.