updated plugin Jetpack Protect version 1.4.2

This commit is contained in:
2023-10-22 22:21:06 +00:00
committed by Gitium
parent f512d25847
commit f07dfae114
242 changed files with 6494 additions and 1502 deletions

View File

@ -128,6 +128,7 @@ class Jetpack_Options {
'partner_coupon_added', // (string) A date for when `partner_coupon` was added, so we can auto-purge after a certain time interval.
'dismissed_backup_review_restore', // (bool) Determines if the component review request is dismissed for successful restore requests.
'dismissed_backup_review_backups', // (bool) Determines if the component review request is dismissed for successful backup requests.
'identity_crisis_url_secret', // (array) The IDC URL secret and its expiration date.
);
}

View File

@ -94,7 +94,7 @@ class Jetpack_Signature {
// and encoded on the Jetpack side.
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
// phpcs:ignore WordPress.Security.NonceVerification.Missing
if ( empty( $body ) && is_array( $_POST ) && count( $_POST ) > 0 ) {
if ( empty( $body ) && is_array( $_POST ) && $_POST !== array() ) {
$body = $_POST; // phpcs:ignore WordPress.Security.NonceVerification.Missing
}
}
@ -105,7 +105,7 @@ class Jetpack_Signature {
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
$put_data = json_decode( $raw_put_data, true );
if ( is_array( $put_data ) && count( $put_data ) > 0 ) {
if ( is_array( $put_data ) && $put_data !== array() ) {
$body = $put_data;
}
}
@ -166,7 +166,7 @@ class Jetpack_Signature {
// If we got an array at this point, let's encode it, so we can see what it looks like as a string.
if ( is_array( $body ) ) {
if ( count( $body ) > 0 ) {
if ( $body !== array() ) {
// phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode
$body = json_encode( $body );
@ -257,7 +257,7 @@ class Jetpack_Signature {
}
$normalized_request_pieces = $flat_normalized_request_pieces;
$normalized_request_string = join( "\n", $normalized_request_pieces ) . "\n";
$normalized_request_string = implode( "\n", $normalized_request_pieces ) . "\n";
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
return base64_encode( hash_hmac( 'sha1', $normalized_request_string, $this->secret, true ) );

View File

@ -221,6 +221,7 @@ class Jetpack_Tracks_Client {
return array(
'blogid' => Jetpack_Options::get_option( 'id', 0 ),
'email' => $user_data['email'],
'userid' => $user_data['ID'],
'username' => $user_data['login'],
'user_locale' => $user_data['user_locale'],

View File

@ -762,17 +762,28 @@ class Jetpack_XMLRPC_Server {
}
/**
* Returns the home URL and site URL for the current site which can be used on the WPCOM side for
* Returns the home URL, site URL, and URL secret for the current site which can be used on the WPCOM side for
* IDC mitigation to decide whether sync should be allowed if the home and siteurl values differ between WPCOM
* and the remote Jetpack site.
*
* @since 1.56.0 Additional data may be added via filter `jetpack_connection_validate_urls_for_idc_mitigation_response`.
*
* @return array
*/
public function validate_urls_for_idc_mitigation() {
return array(
$response = array(
'home' => Urls::home_url(),
'siteurl' => Urls::site_url(),
);
/**
* Allows modifying the response.
*
* @since 1.56.0
*
* @param array $response
*/
return apply_filters( 'jetpack_connection_validate_urls_for_idc_mitigation_response', $response );
}
/**
@ -863,5 +874,4 @@ class Jetpack_XMLRPC_Server {
}
return array();
}
}