Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed May 16, 2023
2 parents 30c70c0 + 673d852 commit 918f1bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Utility/HtaccessManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(Paths $paths, CookieFactory $cookie, SettingsReposit
}

/**
* Updates the .htaccess file with the new LSCache block content. If the LSCache block is already there, it replaces it. Otherwise, it appends it
* Updates the .htaccess file with the new LSCache block content. If the LSCache block is already there, it replaces it. Otherwise, it appends it.
* @throws FileNotFoundException
*/
public function updateHtaccess(): void
Expand Down Expand Up @@ -97,6 +97,7 @@ private function hasLsCacheBlock(string $htaccessContent): bool
private function replaceLsCacheBlock(string $htaccessContent, string $newContent): string
{
$pattern = '/'.preg_quote(self::BEGIN_LSCACHE, '/').'.*'.preg_quote(self::END_LSCACHE, '/').'/s';

return preg_replace($pattern, $newContent, $htaccessContent);
}

Expand All @@ -107,7 +108,7 @@ private function prependLsCacheBlock(string $htaccessContent, string $newContent
}

/**
* Removes the LSCache block from the .htaccess file. If the block is not present, it does nothing
* Removes the LSCache block from the .htaccess file. If the block is not present, it does nothing.
* @throws FileNotFoundException
*/
public function removeLsCacheBlock(): void
Expand Down

0 comments on commit 918f1bd

Please sign in to comment.