diff --git a/features/checksum-core.feature b/features/checksum-core.feature index fffcc0b2..f58e26f0 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 @@ -169,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 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/' )