Issue with very long useragent.
-
Latest version, running on windows.
Every time I get a user with a too long useragent, I have php errors in my log.
I don’t know if it’s only related to windows or linux.
I had to edit these files to stop getting TONS of errors in my php.log.Issue is in function isUABlocked, in 2 different files.
Changes I did:
1. wfutils.php, line 1264
$ua = !empty($_SERVER[‘HTTP_USER_AGENT’]) ? $_SERVER[‘HTTP_USER_AGENT’] : ”;
$ua = substr($ua, 0, 250);
return fnmatch($uaPattern, $ua, FNM_CASEFOLD);2. utils.php, line 583
$ualeft = substr($ua, 0, 250);
return fnmatch($uaPattern, $ualeft, FNM_CASEFOLD);Error I got in my php.log file:
PHP Warning: fnmatch(): Filename exceeds the maximum allowed length of 260 characters in […]\wp-content\plugins\wordfence\vendor\wordfence\wf-waf\src\lib\utils.php on line 586PHP Warning: fnmatch(): Filename exceeds the maximum allowed length of 260 characters in […]\wp-content\plugins\wordfence\lib\wfUtils.php on line 1265
- The topic ‘Issue with very long useragent.’ is closed to new replies.