From 38653009a7ad4277d66a5cb282a0ca14c05c1bc6 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Wed, 31 May 2023 16:24:34 -0400 Subject: [PATCH 1/3] Don't warn about .htaccess file when --include-root is used --- src/Checksum_Core_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Checksum_Core_Command.php b/src/Checksum_Core_Command.php index eed09828..a6d76cba 100644 --- a/src/Checksum_Core_Command.php +++ b/src/Checksum_Core_Command.php @@ -151,7 +151,7 @@ public function __invoke( $args, $assoc_args ) { */ protected function filter_file( $filepath ) { if ( true === $this->include_root ) { - return ( 1 !== preg_match( '/^(wp-config\.php$|wp-content\/)/', $filepath ) ); + return ( 1 !== preg_match( '/^(\.htaccess$|wp-config\.php$|wp-content\/)/', $filepath ) ); } return ( 0 === strpos( $filepath, 'wp-admin/' ) From ad0768b147c1749619410080d8c9fecfb9477fa4 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Wed, 31 May 2023 16:50:07 -0400 Subject: [PATCH 2/3] add .htaccess file to tests --- features/checksum-core.feature | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/checksum-core.feature b/features/checksum-core.feature index fffcc0b2..172e204e 100644 --- a/features/checksum-core.feature +++ b/features/checksum-core.feature @@ -147,6 +147,10 @@ Feature: Validate checksums for WordPress install Scenario: Verify core checksums when extra files are included in WordPress root and --include-root is passed Given a WP install + And a .htaccess file: + """ + # BEGIN WordPress + """ And a extra-file.php file: """ hello world From 9209171af370091db2a9075c9470f83599c4efef Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Wed, 31 May 2023 16:53:36 -0400 Subject: [PATCH 3/3] update test output for htaccess --- features/checksum-core.feature | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/checksum-core.feature b/features/checksum-core.feature index 172e204e..f58e26f0 100644 --- a/features/checksum-core.feature +++ b/features/checksum-core.feature @@ -173,6 +173,10 @@ Feature: Validate checksums for WordPress install """ Warning: File should not exist: extra-file.php """ + And STDERR should not contain: + """ + Warning: File should not exist: .htaccess + """ And STDERR should not contain: """ Warning: File should not exist: wp-content/unknown-file.php