| @@ -32,9 +32,9 @@ | ||
| 32 | 32 | */ |
| 33 | 33 | public function is_valid_gif( $url ) { |
| 34 | 34 | $type = wp_check_filetype( $url, [ 'gif' => 'image/gif' ] ); |
| 35 | 35 | |
| 36 | - if ( ! isset( $type['ext'] ) || empty( $type['ext'] ) ) { | |
| 36 | + if ( empty( $type['ext'] ) ) { | |
| 37 | 37 | return false; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return true; |
| @@ -44,18 +44,16 @@ | ||
| 44 | 44 | * Check if the url has an accepted mime type extension. |
| 45 | 45 | * |
| 46 | 46 | * @param mixed $url The url to check. |
| 47 | 47 | * |
| 48 | - * @return bool | |
| 48 | + * @return bool|string | |
| 49 | 49 | */ |
| 50 | 50 | public function is_valid_mimetype_from_url( $url, $filters = [] ) { |
| 51 | 51 | $type = wp_check_filetype( $url, Optml_Config::$all_extensions ); |
| 52 | 52 | |
| 53 | - if ( ! isset( $type['ext'] ) || empty( $type['ext'] ) ) { | |
| 53 | + if ( empty( $type['ext'] ) ) { | |
| 54 | 54 | return false; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return Optml_Filters::should_do_extension( $filters, $type['ext'] ); |
| 58 | 58 | } |
| 59 | - | |
| 60 | - | |
| 61 | 59 | } |