Skip to content

Commit 495197b

Browse files
committed
Fixed duplication issue when deleting SVGs (#8)
1 parent 00193d0 commit 495197b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

app/Core.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,17 @@ public function post_mime_types_filter( $post_mime_types ) {
201201
private function get_upload_filetype( $path ) {
202202

203203
$file_type = wp_check_filetype( $path );
204+
$result = null;
204205
if( isset( $file_type['type'] ) && strstr( $file_type['type'], '/' ) ) {
205-
return current( explode( '/', $file_type['type'] ) );
206-
} else {
207-
return null;
206+
$result = current( explode( '/', $file_type['type'] ) );
207+
208+
if( $result == 'image' && strpos( $file_type['type'], 'svg' ) !== false ) {
209+
$result = end( explode( '/', $file_type['type'] ) );
210+
}
208211
}
209212

213+
return $result;
214+
210215
}
211216

212217
/**

0 commit comments

Comments
 (0)