Can the content filter regex backtracks be optimized?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- php
- Domain
- performance
Research direction
No file or test is named. Start at the content-filter path that calls preg_replace_callback(), reproduce the failure with a roughly 518K JSON payload, and trace how the output buffer is processed. Done means large post_content values complete without missing output or unexplained errors.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- PHP
- Stars
- 26
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from littlebizzy/force-https
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
littlebizzy/force-https#11 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
-
Disable nag notices Open
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
littlebizzy/force-https#4 · 2 comments ·
All issues in littlebizzy/force-https
Similar issues
-
status/awaiting_triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
WordPress/plugin-check#1486 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
az-digital/az_quickstart#6019 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
grokability/snipe-it#19688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100