Skip to content

Commit f1d5beb

Browse files
Coding Standards: Remove redundant check in WP_Upgrader:maintenance_mode().
The first part of the conditional checks if `$enable` is truthy, so it is always false in the `elseif`. Follow-up to [11005]. Props justlevine. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60417 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c660027 commit f1d5beb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/wp-admin/includes/class-wp-upgrader.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,18 +1022,21 @@ public function maintenance_mode( $enable = false ) {
10221022
}
10231023

10241024
$file = $wp_filesystem->abspath() . '.maintenance';
1025+
10251026
if ( $enable ) {
10261027
if ( ! wp_doing_cron() ) {
10271028
$this->skin->feedback( 'maintenance_start' );
10281029
}
1030+
10291031
// Create maintenance file to signal that we are upgrading.
10301032
$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
10311033
$wp_filesystem->delete( $file );
10321034
$wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
1033-
} elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
1035+
} elseif ( $wp_filesystem->exists( $file ) ) {
10341036
if ( ! wp_doing_cron() ) {
10351037
$this->skin->feedback( 'maintenance_end' );
10361038
}
1039+
10371040
$wp_filesystem->delete( $file );
10381041
}
10391042
}

0 commit comments

Comments
 (0)