Skip to content

Commit ae420d8

Browse files
Don't warn about a .maintenance file in the root directory (#114)
* don't warn about .maintenance file * fix: add tests for .maintenance
1 parent b22bbf0 commit ae420d8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

features/checksum-core.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ Feature: Validate checksums for WordPress install
151151
"""
152152
# BEGIN WordPress
153153
"""
154+
And a .maintenance file:
155+
"""
156+
<?php
157+
$upgrading = time();
158+
"""
154159
And a extra-file.php file:
155160
"""
156161
hello world
@@ -177,6 +182,10 @@ Feature: Validate checksums for WordPress install
177182
"""
178183
Warning: File should not exist: .htaccess
179184
"""
185+
And STDERR should not contain:
186+
"""
187+
Warning: File should not exist: .maintenance
188+
"""
180189
And STDERR should not contain:
181190
"""
182191
Warning: File should not exist: wp-content/unknown-file.php

src/Checksum_Core_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function __invoke( $args, $assoc_args ) {
151151
*/
152152
protected function filter_file( $filepath ) {
153153
if ( true === $this->include_root ) {
154-
return ( 1 !== preg_match( '/^(\.htaccess$|wp-config\.php$|wp-content\/)/', $filepath ) );
154+
return ( 1 !== preg_match( '/^(\.htaccess$|\.maintenance$|wp-config\.php$|wp-content\/)/', $filepath ) );
155155
}
156156

157157
return ( 0 === strpos( $filepath, 'wp-admin/' )

0 commit comments

Comments
 (0)