Bad behavior errors on PHP 8.1 & 8.2 March 17, 2023, 11:13:19 am Using PHP 8.1 I see this error in Elkarte log:Type of error: GeneralUnknown Error: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecatedFile: /sources/ext/bad-behavior/bad-behavior/blacklist.inc.phpLine: 170Code: [Select]164: // Do not edit below this line.165: 166: @$ua = $package['headers_mixed']['User-Agent'];167: @$uri = $package['request_uri'];168: 169: foreach ($bb2_spambots_0 as $spambot) {170: $pos = strpos($ua, $spambot);171: if ($pos !== FALSE && $pos == 0) {172: return "17f4e8c8";173: }174: }Using PHP 8.2 I get this error:
Re: Bad behavior errors on PHP 8.1 & 8.2 Reply #1 – March 17, 2023, 03:20:38 pm All part of the reason I dropped this feature in 2.0 and added our own smaller set of checks that BB did perform. BB has not been updated in some time, and the licensing is a bit persnickety which is why I don't patch it myself.Anyway, at line 168 add $ua = $ua ?? ''; and see if that clears the log.
Re: Bad behavior errors on PHP 8.1 & 8.2 Reply #2 – March 18, 2023, 05:06:25 am Ok, thanks again, just did that edit, let you know in the next days if it helped.