Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: LogViewer parser regex is greedier than it should be #3683

Closed
aricooperdavis opened this issue Feb 8, 2023 · 0 comments
Closed

Bug: LogViewer parser regex is greedier than it should be #3683

aricooperdavis opened this issue Feb 8, 2023 · 0 comments

Comments

@aricooperdavis
Copy link
Contributor

The regex used by the Grav\Common\Helpers\LogViewer class to parse lines from the grav.log is too greedy, which means that some log lines are not parsed as expected.

For example, the following lines

[2023-02-08 05:05:03] grav.DEBUG: [IP Blacklist] Request matched filter '/\.env': 'https://cooper-davis.net/.env' [] []
[2023-02-08 05:05:03] grav.DEBUG: [IP Blacklist] IP blacklisted: '144.48.81.111' [] []
[2023-02-08 05:05:04] grav.DEBUG: [IP Blacklist] IP reported: '144.48.81.111' [] []
[2023-02-08 05:05:04] grav.DEBUG: [IP Blacklist] Request rejected: 'https://cooper-davis.net/.env' [] []

are parsed and displayed in the admin log viewer tool as

image

This is any easy fix; I'll submit a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant