Skip to content

Commit

Permalink
Super Cache: Make sure plugin links is an array before using it (#37604)
Browse files Browse the repository at this point in the history
* Add array check before using the $links array.

* changelog

* Fix path to wp-cache.php

---------

Co-authored-by: Peter Petrov <[email protected]>

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

Upstream-Ref: Automattic/jetpack@a612be4
  • Loading branch information
dilirity authored and matticbot committed Jun 13, 2024
1 parent a58a140 commit 3b82b07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is an alpha version! The changes listed here are not final.
- Updated package dependencies.

### Fixed
- 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.

## [1.12.1] - 2024-05-09
Expand Down
2 changes: 1 addition & 1 deletion wp-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -2920,7 +2920,7 @@ function wp_cache_plugin_notice( $plugin ) {
add_action( 'after_plugin_row', 'wp_cache_plugin_notice' );

function wp_cache_plugin_actions( $links, $file ) {
if( $file == 'wp-super-cache/wp-cache.php' && function_exists( 'admin_url' ) ) {
if ( $file === 'wp-super-cache/wp-cache.php' && function_exists( 'admin_url' ) && is_array( $links ) ) {
$settings_link = '<a href="' . admin_url( 'options-general.php?page=wpsupercache' ) . '">' . __( 'Settings', 'wp-super-cache' ) . '</a>';
array_unshift( $links, $settings_link ); // before other links
}
Expand Down

0 comments on commit 3b82b07

Please sign in to comment.