updated plugin Jetpack Protect version 1.3.0

This commit is contained in:
2023-03-17 22:34:13 +00:00
committed by Gitium
parent 19e086d1c4
commit 1e9ac45ec6
183 changed files with 4388 additions and 2345 deletions

View File

@ -27,6 +27,14 @@ class Jetpack_Signature {
*/
public $secret;
/**
* Timezone difference (in seconds).
*
* @access public
* @var int
*/
public $time_diff;
/**
* The current request URL.
*
@ -66,12 +74,10 @@ class Jetpack_Signature {
if ( ! in_array( $scheme, array( 'http', 'https' ), true ) ) {
return new WP_Error( 'invalid_scheme', 'Invalid URL scheme' );
}
} elseif ( is_ssl() ) {
$scheme = 'https';
} else {
if ( is_ssl() ) {
$scheme = 'https';
} else {
$scheme = 'http';
}
$scheme = 'http';
}
$port = $this->get_current_request_port();
@ -205,14 +211,12 @@ class Jetpack_Signature {
if ( ! empty( $parsed['port'] ) ) {
$port = $parsed['port'];
} elseif ( 'http' === $parsed['scheme'] ) {
$port = 80;
} elseif ( 'https' === $parsed['scheme'] ) {
$port = 443;
} else {
if ( 'http' === $parsed['scheme'] ) {
$port = 80;
} elseif ( 'https' === $parsed['scheme'] ) {
$port = 443;
} else {
return new WP_Error( 'unknown_scheme_port', "The scheme's port is unknown", compact( 'signature_details' ) );
}
return new WP_Error( 'unknown_scheme_port', "The scheme's port is unknown", compact( 'signature_details' ) );
}
if ( ! ctype_digit( "$timestamp" ) || 10 < strlen( $timestamp ) ) { // If Jetpack is around in 275 years, you can blame mdawaffe for the bug.

View File

@ -220,9 +220,10 @@ class Jetpack_Tracks_Client {
}
return array(
'blogid' => Jetpack_Options::get_option( 'id', 0 ),
'userid' => $user_data['ID'],
'username' => $user_data['login'],
'blogid' => Jetpack_Options::get_option( 'id', 0 ),
'userid' => $user_data['ID'],
'username' => $user_data['login'],
'user_locale' => $user_data['user_locale'],
);
}
}

View File

@ -42,6 +42,7 @@
/**
* Class Jetpack_Tracks_Event
*/
#[AllowDynamicProperties]
class Jetpack_Tracks_Event {
const EVENT_NAME_REGEX = '/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/';
const PROP_NAME_REGEX = '/^[a-z_][a-z0-9_]*$/';