• Resolved foxontherock

    (@foxontherock)


    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 586

    PHP Warning: fnmatch(): Filename exceeds the maximum allowed length of 260 characters in […]\wp-content\plugins\wordfence\lib\wfUtils.php on line 1265

    • This topic was modified 7 years, 8 months ago by foxontherock.
Viewing 1 replies (of 1 total)
  • Hi,
    This issue can be reproduced only on Windows servers, we have a ticket for this issue on our system (reference number: #4103) that should address this one in any of the upcoming releases, but I don’t have an ETA yet, as you know running Wordfence on Windows servers aren’t officially supported at the moment.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with very long useragent.’ is closed to new replies.