PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-videopress/src/class-xmlrpc.php +18 -3 13.5.2 → 16.3 View file →
@@ -60,9 +60,9 @@
60 60 * @param WP_User $user The user object the API request is signed by.
61 61 *
62 62 * @return array
63 63 */
64 - public function xmlrpc_methods( $methods, $core_methods, $user ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
64 + public function xmlrpc_methods( $methods, $core_methods, $user ) {
65 65 if ( $user && $user instanceof WP_User ) {
66 66 $this->current_user = $user;
67 67 }
68 68
@@ -87,12 +87,27 @@
87 87 public function create_media_item( $media ) {
88 88 $this->authenticate_user();
89 89
90 90 foreach ( $media as & $media_item ) {
91 - $title = sanitize_title( basename( $media_item['url'] ) );
92 - $guid = isset( $media['guid'] ) ? $media['guid'] : null;
91 + $url = is_string( $media_item['url'] ?? null ) ? $media_item['url'] : '';
92 + $title = isset( $media_item['title'] ) && '' !== $media_item['title']
93 + ? sanitize_text_field( $media_item['title'] )
94 + : sanitize_title( basename( $url ) );
95 + $guid = $media['guid'] ?? null;
93 96
94 97 $media_id = videopress_create_new_media_item( $title, $guid );
98 +
99 + $post_update = array();
100 + if ( isset( $media_item['description'] ) && '' !== $media_item['description'] ) {
101 + $post_update['post_content'] = sanitize_textarea_field( $media_item['description'] );
102 + }
103 + if ( isset( $media_item['caption'] ) && '' !== $media_item['caption'] ) {
104 + $post_update['post_excerpt'] = sanitize_textarea_field( $media_item['caption'] );
105 + }
106 + if ( $post_update ) {
107 + $post_update['ID'] = $media_id;
108 + wp_update_post( $post_update );
109 + }
95 110
96 111 wp_update_attachment_metadata(
97 112 $media_id,
98 113 array(