Skip to content

Commit

Permalink
Merge branch 'develop' into disallow-file-mods
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion authored Oct 17, 2023
2 parents 0ca0627 + 0bd05a4 commit 1f9fff0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions classes/Activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ public function activate( $sitewide = false ) {
}

/**
* @param bool $network_wide
* @return void
*/
public function deactivate() {
public function deactivate( $network_wide = false ) {
$admins = QM_Util::get_admins();

// Remove legacy capability handling:
if ( $admins ) {
$admins->remove_cap( 'view_query_monitor' );
}

# Only delete db.php if it belongs to Query Monitor
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && class_exists( 'QM_DB', false ) ) {
# Only delete db.php if a single site and db.php belongs to Query Monitor
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && class_exists( 'QM_DB', false ) && ( $network_wide || ! is_multisite() ) ) {
unlink( WP_CONTENT_DIR . '/db.php' ); // phpcs:ignore
}

Expand Down
2 changes: 1 addition & 1 deletion collectors/php_errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function tear_down() {
error_reporting( $this->error_reporting );
}

if ( false !== $this->display_errors ) {
if ( is_string( $this->display_errors ) ) {
ini_set( 'display_errors', $this->display_errors );
}

Expand Down

0 comments on commit 1f9fff0

Please sign in to comment.