Fix image validation

This commit is contained in:
Robin Cornett
2017-11-02 12:46:44 -04:00
parent bad07bd655
commit bca243f9cc
3 changed files with 23 additions and 46 deletions
@@ -177,29 +177,6 @@ class Display_Featured_Image_Genesis_Settings_Validate extends Display_Featured_
return $message;
}
/**
* check if file type is image. updated to use WP function.
* @return bool
* @since 1.2.2
* @since 2.5.0
*/
protected function is_valid_img_ext( $file ) {
$valid = wp_check_filetype( $file );
return (bool) in_array( $valid['ext'], $this->allowed_file_types(), true );
}
/**
* Define the array of allowed image/file types.
* @return array
* @since 2.5.0
*/
protected function allowed_file_types() {
$allowed = apply_filters( 'displayfeaturedimage_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif' ) );
return is_array( $allowed ) ? $allowed : explode( ',', $allowed );
}
/**
* Returns a 1 or 0, for all truthy / falsy values.
*