updated plugin Jetpack Protect
version 1.1.2
This commit is contained in:
@ -5,6 +5,13 @@ 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.21] - 2022-11-22
|
||||
### Added
|
||||
- Add a guard in `functions.php` against being loaded twice from different copies of the package. [#27475]
|
||||
|
||||
### Changed
|
||||
- Updated package dependencies. [#27043]
|
||||
|
||||
## [1.4.20] - 2022-11-07
|
||||
### Fixed
|
||||
- Ensure that User_Agent is loaded in environments without autoload enabled. (e.g.: WordPress.com and Super Cache) [#27223]
|
||||
@ -132,6 +139,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Moving jetpack_is_mobile into a package
|
||||
|
||||
[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
|
||||
[1.4.19]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.18...v1.4.19
|
||||
[1.4.18]: https://github.com/Automattic/jetpack-device-detection/compare/v1.4.17...v1.4.18
|
||||
|
@ -6,7 +6,7 @@
|
||||
"require": {},
|
||||
"require-dev": {
|
||||
"yoast/phpunit-polyfills": "1.0.3",
|
||||
"automattic/jetpack-changelogger": "^3.2"
|
||||
"automattic/jetpack-changelogger": "^3.2.1"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -7,25 +7,30 @@
|
||||
|
||||
namespace Automattic\Jetpack\Device_Detection;
|
||||
|
||||
/**
|
||||
* A wrapper for WordPress's `wp_unslash()`.
|
||||
*
|
||||
* Even though PHP itself dropped the option to add slashes to superglobals a decade ago,
|
||||
* WordPress still does it through some misguided extreme backwards compatibility. 🙄
|
||||
*
|
||||
* If WordPress's function exists, assume it needs to be called.
|
||||
* Else if on WordPress.com, do a simplified version because we're running really early.
|
||||
* Else, assume it's not needed.
|
||||
*
|
||||
* @param string $value String of data to unslash.
|
||||
* @return string Possibly unslashed $value.
|
||||
*/
|
||||
function wp_unslash( $value ) {
|
||||
if ( function_exists( '\\wp_unslash' ) ) {
|
||||
return \wp_unslash( $value );
|
||||
} elseif ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
|
||||
return stripslashes( $value );
|
||||
} else {
|
||||
return $value;
|
||||
// Check if the function is already defined, in case someone bypassed the autoloader or something
|
||||
// to get the two classes from different copies of the package.
|
||||
if ( ! function_exists( __NAMESPACE__ . '\\wp_unslash' ) ) {
|
||||
|
||||
/**
|
||||
* A wrapper for WordPress's `wp_unslash()`.
|
||||
*
|
||||
* Even though PHP itself dropped the option to add slashes to superglobals a decade ago,
|
||||
* WordPress still does it through some misguided extreme backwards compatibility. 🙄
|
||||
*
|
||||
* If WordPress's function exists, assume it needs to be called.
|
||||
* Else if on WordPress.com, do a simplified version because we're running really early.
|
||||
* Else, assume it's not needed.
|
||||
*
|
||||
* @param string $value String of data to unslash.
|
||||
* @return string Possibly unslashed $value.
|
||||
*/
|
||||
function wp_unslash( $value ) {
|
||||
if ( function_exists( '\\wp_unslash' ) ) {
|
||||
return \wp_unslash( $value );
|
||||
} elseif ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
|
||||
return stripslashes( $value );
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user