From 4290c82321b8d08fd20770e23822d9a9522ce8e2 Mon Sep 17 00:00:00 2001 From: Caspar Green Date: Tue, 23 Feb 2021 09:42:15 -0500 Subject: [PATCH] Closes #3113 Stop removing empty lines in the .htaccess (PR #3599) --- inc/functions/htaccess.php | 13 ------------- tests/Fixtures/content/htaccessContent.php | 5 +++++ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/inc/functions/htaccess.php b/inc/functions/htaccess.php index ce910c8f59..1a326ea23d 100755 --- a/inc/functions/htaccess.php +++ b/inc/functions/htaccess.php @@ -18,7 +18,6 @@ function flush_rocket_htaccess( $remove_rules = false ) { // phpcs:ignore WordPr * Filters disabling of WP Rocket htaccess rules * * @since 3.2.5 - * @author Remy Perona * * @param bool $disable True to disable, false otherwise. */ @@ -56,18 +55,6 @@ function flush_rocket_htaccess( $remove_rules = false ) { // phpcs:ignore WordPr $ftmp = get_rocket_htaccess_marker() . PHP_EOL . $ftmp; } - /** - * Determine if empty lines should be removed in the .htaccess file. - * - * @since 2.10.7 - * @author Remy Perona - * - * @param boolean $remove_empty_lines True to remove, false otherwise. - */ - if ( apply_filters( 'rocket_remove_empty_lines', true ) ) { - $ftmp = preg_replace( "/\n+/", "\n", $ftmp ); - } - // Make sure the WP rules are still there. if ( $has_wp_rules && ! rocket_has_wp_htaccess_rules( $ftmp ) ) { return false; diff --git a/tests/Fixtures/content/htaccessContent.php b/tests/Fixtures/content/htaccessContent.php index d2450e5b92..4bec1ba06d 100644 --- a/tests/Fixtures/content/htaccessContent.php +++ b/tests/Fixtures/content/htaccessContent.php @@ -10,6 +10,7 @@ AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml + # FileETag None is not enough for every server. Header unset ETag @@ -18,6 +19,7 @@ HTACCESS; $fileETag = << + # Allow access to web fonts from all domains. @@ -42,6 +45,7 @@ + HTACCESS; $mod_alias = <<