Skip to content
New issue

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

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

Already on GitHub? # to your account

Can the content filter regex backtracks be optimized? #10

Open
deltafactory opened this issue Jan 18, 2019 · 0 comments
Open

Can the content filter regex backtracks be optimized? #10

deltafactory opened this issue Jan 18, 2019 · 0 comments

Comments

@deltafactory
Copy link

I have an edge-case scenario but wanted to suggest an improvement because it "could" affect users some day.

I am applying the content filter as an output buffer so that I can also convert non-https links outside of the post content. When applied to a 518K JSON payload, the preg_replace_callback() function fails. I could likely address this by modifying the pcre backtrack/recursion limits on my server.

Your users may trigger a similar edge case only if they have a large post_content field - unlikely, but remotely possible and a nasty gremlin to detect as there are no errors to explain the missing output.

I would submit a patch if/when I raise my regex game.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

1 participant