application icon indicating copy to clipboard operation
application copied to clipboard

stripos null user agent warning

Open wussup opened this issue 1 year ago • 2 comments

stripos can not take a null value as an argument in PHP 8.1+

Deprecated: strpos(): Passing null to parameter #1 ($haystack)

Summary of Changes

check $userAgent before use stripos() function

Testing Instructions

make GET request without User Agent header

Documentation Changes Required

nothing

wussup avatar Jul 08 '24 14:07 wussup

Thanks for the PR.

Sorry for the delay in replying:

  • Please fix the code style issues
  • It would be better to make an early return when the $userAgent is empty, moving "$this->detection['engine'] = true;" to the top of the functions is fine
  • Please make the change for all detect functions.

rdeutz avatar Aug 07 '24 16:08 rdeutz

Alternative PR #131

Quy avatar Oct 02 '24 20:10 Quy

Thank you for proposing this. As @Quy provided a better alternative, we are going with that one. Because of that, I'm closing this one. Thank you for your time.

Hackwar avatar Oct 08 '24 21:10 Hackwar