PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / trunk
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization vtrunk
4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 All 135 releases
← All changes | inc/traits/validator.php +3 -5 3.0.1 → trunk View file →
@@ -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 }