fixes #7002 - filter rocket_lrc_processor to use regex if DOM extension is not found #7218
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
as discussed with @wordpressfan switch
rocket_lrc_processor
to regex if PHPdom
extension is not foundDescription
Fixes #7002
Here we check if the dom module is loaded in php so use the dom processor other than that use the regex which should do the same functionality.
Type of change
Detailed scenario
Disable the DOM extension, see a 500 error in the site frontend, in the console (As described in the issue).
With the new code, if DOM extension is not available it should switch rocket_lrc_processor to use regex instead, preventing the error
Technical description
Documentation
Mentioned above.
New dependencies
No.
Risks
In a few cases we may face slowness when using regex but I believe this will be better than the error 500.
Mandatory Checklist
Code validation
Code style
Unticked items justification
Because results for dom and regex are the same so we don't need to change anything in tests, we have integration tests covering this method.
Additional Checks