-
Notifications
You must be signed in to change notification settings - Fork 223
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
Fixes #928 Prevent corruption of htaccess file on update #6106
Conversation
@Tabrisrp tests are failing |
@Tabrisrp Thanks for the PR. |
The 2nd and 4th points look like something we should take a look at |
@Mai-Saad @piotrbak Also when we deactivate WPR, we are calling So, this is expected from our side and to fix the points u mentioned I need to use the old |
Modifying the file ourselves to remove the leftover comments would be a risk to get back to the issue we're trying to fix. Those 2 points are a change compared to before, but should have no impact on the functionality itself. |
Exactly, that's why I mentioned here first without implementing it. |
I think rewrite rules are order-sensitive in htaccess ; aren't we using some? The idea of our fix was to leverage WP Core implementation as we think it is safer than what we have currently in the plugin. But if that implementation does not fit exactly our need, would you consider duplicating |
@Tabrisrp Thanks for the updates, Currently WPR rules are added at the beginning of the file same as on trunk. However, |
@Tabrisrp Do you see why the comment is preserved? I'm thinking about any other possible conflicts there, it would be good to fully clean the files after deactivation |
Updated the code to completely remove the markers when deactivating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as expected now and markers have been removed
Description
Update the
flush_rocket_htaccess()
function to useinsert_with_markers()
function instead of custom code to update the htaccess file content with WP Rocket rules.Fixes #928
Type of change
Is the solution different from the one proposed during the grooming?
No
How Has This Been Tested?
Checklist: