Skip to content

Commit

Permalink
Status package add is string check to compat check (#37256)
Browse files Browse the repository at this point in the history
* Added is_string check prior to using str_starts_with

* Changelog
  • Loading branch information
darssen authored and pkuliga committed May 9, 2024
1 parent 80bb8ed commit d208759
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Status: Added check for compatibility reasons
2 changes: 1 addition & 1 deletion projects/packages/status/src/class-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function get_file_data( $file, $headers ) {
}

$key = md5( $file_name . maybe_serialize( $headers ) );
$refresh_cache = is_admin() && isset( $_GET['page'] ) && str_starts_with( $_GET['page'], 'jetpack' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput
$refresh_cache = is_admin() && isset( $_GET['page'] ) && is_string( $_GET['page'] ) && str_starts_with( $_GET['page'], 'jetpack' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput

// If we don't need to refresh the cache, and already have the value, short-circuit!
if ( ! $refresh_cache && isset( $file_data_option[ $key ] ) ) {
Expand Down

0 comments on commit d208759

Please sign in to comment.