Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions features/checksum-core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Checksum_Core_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/' )
Expand Down