Skip to content

Optimization: Avoid last loop and storing an empty value in case nothing after last %{..} macro #3004

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

Merged
merged 5 commits into from
Feb 1, 2024

Conversation

marcstern
Copy link

In case of macro replacement, when we have a string like this (quite common) "something %{..}", after the macro replacement, we process the next part, which is an empty string, and we store it in the array used to build the final result.
Same for "%{...} something" for the empty string before.
We also store an empty string if the replacement is empty.
This PR fixes these useless code & storage.

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

Successfully merging this pull request may close these issues.

1 participant