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

Fix passing null to string parameter deprecation #86

Closed kocsismate closed 2 years ago

kocsismate commented 2 years ago

Fixing strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated

donatj commented 2 years ago

Do you have a particular UA string that triggers the issue?

kocsismate commented 2 years ago

Do you have a particular UA string that triggers the issue?

Yes, our test suite contains a Lenovo-A880/S100 Linux/3.4.5 Android/4.2 Release/08.07.2013 Browser/AppleWebKit 534.30 Profile/ Configuration; User-Agent value which triggers it.

donatj commented 2 years ago

Thanks! I just wanted to potentially add a regression test. PHP 8.1 is really snippy about strings.

kocsismate commented 2 years ago

I've just added a test. :) Can you please approve the workflow so that CI can be started?

donatj commented 2 years ago

This was manually merged as part of a35900b93530715f8669c10e49756adde5c8e6fc

It has been tagged and released in https://github.com/donatj/PhpUserAgent/releases/tag/v1.7.0

Thanks again!

kocsismate commented 2 years ago

Thank you for your quick help!