diff --git a/wptv2/plugins/wordpresstv-upload-subtitles/wordpresstv-upload-subtitles.php b/wptv2/plugins/wordpresstv-upload-subtitles/wordpresstv-upload-subtitles.php
index 9ee766e66..6848190d9 100644
a
|
b
|
class WordPressTV_Subtitles_Upload { |
139 | 139 | $language = $available_languages[ $language ]; |
140 | 140 | |
141 | 141 | $video_data = function_exists( 'video_get_info_by_blogpostid' ) ? video_get_info_by_blogpostid( get_current_blog_id(), $video_id ) : new StdClass; |
| 142 | l(); |
| 143 | l($video_data->guid); |
142 | 144 | $video_attachment = get_post( $video_id ); |
143 | 145 | if ( empty( $video_data ) || empty( $video_attachment ) ) { |
144 | 146 | wp_die( 'Invalid form data.' ); |
… |
… |
class WordPressTV_Subtitles_Upload { |
150 | 152 | wp_die( 'You can not subtitle this video.' ); |
151 | 153 | } |
152 | 154 | |
153 | | $tracks = class_exists( 'VideoPress_Subtitles' ) ? VideoPress_Subtitles::get_tracks( $video_data->guid ) : array(); |
154 | | if ( ! empty( $tracks[ $language['key'] ] ) ) { |
155 | | $this->error( 8 ); |
156 | | } |
157 | | |
158 | 155 | if ( empty( $_FILES['wptv_subtitles_file']['name'] ) ) { |
159 | 156 | $this->error( 1 ); |
160 | 157 | } |
diff --git a/wptv2/upload-subtitles-template.php b/wptv2/upload-subtitles-template.php
index e5c939bb2..ec221a5ce 100644
a
|
b
|
if ( ! empty( $_REQUEST['error'] ) ) { |
276 | 276 | <select name="wptv_language"> |
277 | 277 | <?php $tracks = VideoPress_Subtitles::get_tracks( $video->guid ); ?> |
278 | 278 | <?php foreach ( VideoPress_Subtitles::get_languages() as $value => $language ) : ?> |
279 | | <option value="<?php echo esc_attr( $value ); ?>" <?php disabled( ! empty( $tracks[ $value ] ) ); ?> ><?php echo esc_html( $language['localized_label'] ); ?></option> |
| 279 | <option value="<?php echo esc_attr( $value ); ?>" ><?php echo esc_html( $language['localized_label'] ); ?></option> |
280 | 280 | <?php endforeach; ?> |
281 | 281 | </select> |
282 | 282 | </td> |