updated plugin Jetpack Protect
version 1.3.0
This commit is contained in:
@ -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.
|
||||
|
@ -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'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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_]*$/';
|
||||
|
Reference in New Issue
Block a user