Skip to content

Commit

Permalink
WPCOM_JSON_API_Upload_Media_v1_1_Endpoint: Fix Fatals from uploads wi…
Browse files Browse the repository at this point in the history
…th invalid media type (#39858)

* WPCOM_JSON_API_Upload_Media_v1_1_Endpoint: Fix Fatals from uploads with invalid media type
  • Loading branch information
fgiannar authored Oct 22, 2024
1 parent ee22181 commit 1527079
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

WPCOM_JSON_API_Upload_Media_v1_1_Endpoint: Fix Fatals from uploads with invalid media type
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function callback( $path = '', $blog_id = 0 ) {

// We're splitting out videos for Jetpack sites.
foreach ( $media_files as $media_item ) {
if ( preg_match( '@^video/@', $media_item['type'] ) && $is_jetpack_site ) {
if ( isset( $media_item['type'] ) && preg_match( '@^video/@', $media_item['type'] ) && $is_jetpack_site ) {
if ( defined( 'IS_WPCOM' ) && IS_WPCOM &&
defined( 'VIDEOPRESS_JETPACK_VIDEO_ENABLED' ) && VIDEOPRESS_JETPACK_VIDEO_ENABLED
) {
Expand Down

0 comments on commit 1527079

Please sign in to comment.