From fe5bad7c812a7cb55376a4d62707fe450f6977d3 Mon Sep 17 00:00:00 2001 From: Vaishali Agola Date: Fri, 8 Jan 2021 18:16:40 +0530 Subject: [PATCH] Resolve issue with Video trancoding thumbnail auto load --- admin/rt-transcoder-handler.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/rt-transcoder-handler.php b/admin/rt-transcoder-handler.php index e68c1eee..8186c8c7 100755 --- a/admin/rt-transcoder-handler.php +++ b/admin/rt-transcoder-handler.php @@ -963,8 +963,14 @@ public function add_transcoded_files( $file_post_array, $attachment_id, $job_for * * @param string $new_wp_attached_file_pathinfo['basename'] Contains the file public name */ - $video_url = apply_filters( 'transcoded_video_filename', $new_wp_attached_file_pathinfo['basename'] ); - $upload_info = wp_upload_bits( $video_url, null, $file_content ); + $file_name = apply_filters( 'transcoded_video_filename', $new_wp_attached_file_pathinfo['basename'] ); + + // Verify Extension. + if ( empty( pathinfo( $file_name, PATHINFO_EXTENSION ) ) ) { + $file_name .= '.' . $new_wp_attached_file_pathinfo['extension']; + } + + $upload_info = wp_upload_bits( $file_name, null, $file_content ); /** * Allow users to filter/perform action on uploaded transcoded file.