updated plugin Jetpack Protect
version 1.3.0
This commit is contained in:
@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.4.24] - 2023-02-20
|
||||
### Changed
|
||||
- Minor internal updates.
|
||||
|
||||
## [1.4.23] - 2023-01-11
|
||||
### Changed
|
||||
- Updated package dependencies.
|
||||
|
||||
## [1.4.22] - 2022-12-02
|
||||
### Changed
|
||||
- Updated package dependencies. [#27688]
|
||||
@ -143,6 +151,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Moving jetpack_is_mobile into a package
|
||||
|
||||
[1.4.24]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.23...v1.4.24
|
||||
[1.4.23]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.22...v1.4.23
|
||||
[1.4.22]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.21...v1.4.22
|
||||
[1.4.21]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.20...v1.4.21
|
||||
[1.4.20]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.19...v1.4.20
|
||||
|
@ -6,7 +6,7 @@
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.4",
|
||||
"automattic/jetpack-changelogger": "^3.2.2"
|
||||
"automattic/jetpack-changelogger": "^3.3.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
@ -17,9 +17,6 @@
|
||||
"phpunit": [
|
||||
"./vendor/phpunit/phpunit/phpunit --colors=always"
|
||||
],
|
||||
"test-coverage": [
|
||||
"php -dpcov.directory=. ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/clover.xml\""
|
||||
],
|
||||
"test-php": [
|
||||
"@composer phpunit"
|
||||
]
|
||||
|
@ -136,10 +136,8 @@ class User_Agent_Info {
|
||||
public function __construct( $ua = '' ) {
|
||||
if ( $ua ) {
|
||||
$this->useragent = $ua;
|
||||
} else {
|
||||
if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
|
||||
$this->useragent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about validating.
|
||||
}
|
||||
} elseif ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
|
||||
$this->useragent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This class is all about validating.
|
||||
}
|
||||
}
|
||||
|
||||
@ -815,12 +813,10 @@ class User_Agent_Info {
|
||||
|
||||
if ( false === strpos( $ua, 'windows phone os 7' ) ) {
|
||||
return false;
|
||||
} elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
|
||||
return false;
|
||||
} else {
|
||||
if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -856,12 +852,10 @@ class User_Agent_Info {
|
||||
|
||||
if ( false === strpos( $ua, 'webos' ) ) {
|
||||
return false;
|
||||
} elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
|
||||
return false;
|
||||
} else {
|
||||
if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1041,12 +1035,10 @@ class User_Agent_Info {
|
||||
|
||||
if ( false === strpos( $ua, 'meego' ) ) {
|
||||
return false;
|
||||
} elseif ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
|
||||
return false;
|
||||
} else {
|
||||
if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1315,20 +1307,17 @@ class User_Agent_Info {
|
||||
$pos_torch = stripos( $agent, 'BlackBerry 9800' );
|
||||
if ( false !== $pos_torch ) {
|
||||
return 'blackberry-torch'; // Match the torch first edition. the 2nd edition should use the OS7 and doesn't need any special rule.
|
||||
} else {
|
||||
// Detecting the BB OS version for devices running OS 6.0 or higher.
|
||||
if ( preg_match( '#Version\/([\d\.]+)#i', $agent, $matches ) ) {
|
||||
$version = $matches[1];
|
||||
$version_num = explode( '.', $version );
|
||||
if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) {
|
||||
return 'blackberry-6'; // not a BB device that match our rule.
|
||||
} else {
|
||||
return 'blackberry-' . $version_num[0];
|
||||
}
|
||||
} else {
|
||||
// if doesn't match returns the minimun version with a webkit browser. we should never fall here.
|
||||
} elseif ( preg_match( '#Version\/([\d\.]+)#i', $agent, $matches ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher.
|
||||
$version = $matches[1];
|
||||
$version_num = explode( '.', $version );
|
||||
if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) {
|
||||
return 'blackberry-6'; // not a BB device that match our rule.
|
||||
} else {
|
||||
return 'blackberry-' . $version_num[0];
|
||||
}
|
||||
} else {
|
||||
// if doesn't match returns the minimun version with a webkit browser. we should never fall here.
|
||||
return 'blackberry-6'; // not a BB device that match our rule.
|
||||
}
|
||||
}
|
||||
|
||||
@ -1360,7 +1349,6 @@ class User_Agent_Info {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1423,7 +1411,6 @@ class User_Agent_Info {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user