@@ 198-204 (lines=7) @@ | ||
195 | ); |
|
196 | ||
197 | add_filter( 'jetpack_supported_media_sideload_types', $mime_type_static_filter ); |
|
198 | if ( |
|
199 | ! self::is_file_supported_for_sideloading( $tmp_filename ) && |
|
200 | ! file_is_displayable_image( $tmp_filename ) |
|
201 | ) { |
|
202 | @unlink( $tmp_filename ); |
|
203 | return new WP_Error( 'invalid_input', 'Invalid file type.', 403 ); |
|
204 | } |
|
205 | remove_filter( 'jetpack_supported_media_sideload_types', $mime_type_static_filter ); |
|
206 | ||
207 | // generate a new file name |
@@ 1874-1877 (lines=4) @@ | ||
1871 | ||
1872 | // First check to see if we get a mime-type match by file, otherwise, check to |
|
1873 | // see if WordPress supports this file as an image. If neither, then it is not supported. |
|
1874 | if ( ! $this->is_file_supported_for_sideloading( $tmp ) || 'image' === $type && ! file_is_displayable_image( $tmp ) ) { |
|
1875 | @unlink( $tmp ); |
|
1876 | return new WP_Error( 'invalid_input', 'Invalid file type.', 403 ); |
|
1877 | } |
|
1878 | ||
1879 | // emulate a $_FILES entry |
|
1880 | $file_array = array( |