diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2019-01-01 22:18:11 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2019-01-01 22:18:11 -0500 |
commit | 018bd442ec1e04ba78a6628763414eb60b359398 (patch) | |
tree | 448cde462397af33e5a964ba5d0803b73c65040e /plugins/jetpack/class.json-api-endpoints.php | |
parent | Update easy-table 1.8 (diff) | |
download | blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.tar.gz blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.tar.bz2 blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.zip |
Update jetpack 6.8.1
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/class.json-api-endpoints.php')
-rw-r--r-- | plugins/jetpack/class.json-api-endpoints.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/jetpack/class.json-api-endpoints.php b/plugins/jetpack/class.json-api-endpoints.php index 48a4c40b..5830d1e8 100644 --- a/plugins/jetpack/class.json-api-endpoints.php +++ b/plugins/jetpack/class.json-api-endpoints.php @@ -257,7 +257,7 @@ abstract class WPCOM_JSON_API_Endpoint { $return = json_decode( $input, true ); if ( function_exists( 'json_last_error' ) ) { - if ( JSON_ERROR_NONE !== json_last_error() ) { + if ( JSON_ERROR_NONE !== json_last_error() ) { // phpcs:ignore PHPCompatibility return null; } } else { @@ -396,6 +396,13 @@ abstract class WPCOM_JSON_API_Endpoint { $return[$key] = false; break; case 'url' : + if ( is_object( $value ) && isset( $value->url ) && false !== strpos( $value->url, 'https://videos.files.wordpress.com/' ) ) { + $value = $value->url; + } + // Check for string since esc_url_raw() expects one. + if ( ! is_string( $value ) ) { + break; + } $return[$key] = (string) esc_url_raw( $value ); break; case 'string' : @@ -1909,6 +1916,7 @@ abstract class WPCOM_JSON_API_Endpoint { */ protected function is_file_supported_for_sideloading( $file ) { if ( class_exists( 'finfo' ) ) { // php 5.3+ + // phpcs:ignore PHPCompatibility.PHP.NewClasses.finfoFound $finfo = new finfo( FILEINFO_MIME ); $mime = explode( '; ', $finfo->file( $file ) ); $type = $mime[0]; |