Skip to content

Commit

Permalink
Super Cache: Avoid a PHP warning about converting false to array (#37…
Browse files Browse the repository at this point in the history
…968)

* Avoid a "false -> array" deprecated PHP notice.

* changelog

* Have phan!

---------

Co-authored-by: Adnan Haque <[email protected]>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/9610429042

Upstream-Ref: Automattic/jetpack@f397fd8
  • Loading branch information
haqadn authored and matticbot committed Jun 21, 2024
1 parent c8b70ed commit 6453744
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This is an alpha version! The changes listed here are not final.

### Fixed
- Super Cache: Align detection of Boost installs with activation of that plugin
- Super Cache: fixed a PHP warning when deactivating the plugin.
- Super Cache: make sure plugins links is an array before using it.
- Super Cache: remove the preload interval based on the post count. Preload as often as you want.

Expand Down
4 changes: 2 additions & 2 deletions wp-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -3741,7 +3741,7 @@ function wp_cache_disable_plugin( $delete_config_file = true ) {
}

uninstall_supercache( WP_CONTENT_DIR . '/cache' );
$file_not_deleted = false;
$file_not_deleted = array();
wpsc_remove_advanced_cache();
if ( @file_exists( WP_CONTENT_DIR . "/advanced-cache.php" ) ) {
$file_not_deleted[] = WP_CONTENT_DIR . '/advanced-cache.php';
Expand All @@ -3750,7 +3750,7 @@ function wp_cache_disable_plugin( $delete_config_file = true ) {
if ( false == unlink( WPCACHECONFIGPATH . "/wp-cache-config.php" ) )
$file_not_deleted[] = WPCACHECONFIGPATH . '/wp-cache-config.php';
}
if ( $file_not_deleted ) {
if ( ! empty( $file_not_deleted ) ) {
$msg = __( "Dear User,\n\nWP Super Cache was removed from your blog or deactivated but some files could\nnot be deleted.\n\n", 'wp-super-cache' );
foreach( (array)$file_not_deleted as $path ) {
$msg .= "{$path}\n";
Expand Down

0 comments on commit 6453744

Please sign in to comment.