donatj / PhpUserAgent

Lightning Fast, Minimalist PHP User Agent String Parser.
https://donatstudios.com/PHP-Parser-HTTP_USER_AGENT
MIT License
565 stars 128 forks source link

Added some *BSD OSes #45

Closed goshoo closed 6 years ago

goshoo commented 6 years ago

Hi,

I like your parser but I couldn't agree with

if( $platform == 'linux-gnu' || $platform == 'X11' ) { $platform = 'Linux'; }

because all Unix and Unix-like OSes (still) use X11. With this patch I added most used opensource *BSDs - OpenBSD, FreeBSD and NetBSD.

donatj commented 6 years ago

Thank you so much for the contribution! I really appreciate it and am surprised this hasn’t come up sooner.

Could you please add a handful of real life UA strings to the tests/user_agents.json?

goshoo commented 6 years ago

I have no *BSD installed on my computer but I took UA strings from http://www.webapps-online.com

donatj commented 6 years ago

Thank you very much. I have merged your changes.