Skip to content

Htaccess: remove LiteSpeed marker blocks on deactivation - #1068

Open
timotei-litespeed wants to merge 1 commit into
litespeedtech:devfrom
timotei-litespeed:fix-htaccess-empty-markers
Open

timotei-litespeed wants to merge 1 commit into
litespeedtech:devfrom
timotei-litespeed:fix-htaccess-empty-markers

Conversation

@timotei-litespeed

Copy link
Copy Markdown
Contributor

Instead of leaving them empty

Deactivation cleared the LSCACHE and NON_LSCACHE blocks by writing an empty insertion, so "# BEGIN/END LSCACHE" and "# BEGIN/END NON_LSCACHE" stayed in .htaccess, and were even prepended when the markers were already gone.

clear_rules() now removes every copy of both blocks, markers included, in one write and keeps the rest of the file as is. It skips the backup and the write when there is nothing to remove, and never creates a missing .htaccess.

…eaving them empty

Deactivation cleared the LSCACHE and NON_LSCACHE blocks by writing an empty
insertion, so "# BEGIN/END LSCACHE" and "# BEGIN/END NON_LSCACHE" stayed in
.htaccess, and were even prepended when the markers were already gone.

clear_rules() now removes every copy of both blocks, markers included, in one
write and keeps the rest of the file as is. It skips the backup and the write
when there is nothing to remove, and never creates a missing .htaccess.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant