| @@ -76,8 +76,14 @@ | ||
| 76 | 76 | if ( $original_filetype['type'] !== $uploaded_filetype['type'] ) { |
| 77 | 77 | return new WP_Error( 'file_error', __( 'The uploaded file type does not match the original file type.', 'optimole-wp' ) ); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | + if ( $uploaded_filetype['type'] === 'image/svg+xml' ) { | |
| 81 | + if ( ! Optml_Main::instance()->admin->sanitize_svg( $this->file['tmp_name'] ) ) { | |
| 82 | + return new WP_Error( 'file_error', __( 'Error uploading file.', 'optimole-wp' ) ); | |
| 83 | + } | |
| 84 | + } | |
| 85 | + | |
| 80 | 86 | global $wp_filesystem; |
| 81 | 87 | |
| 82 | 88 | if ( ! $wp_filesystem->move( $this->file['tmp_name'], $original_file, true ) ) { |
| 83 | 89 | return new WP_Error( 'file_error', __( 'Could not move file.', 'optimole-wp' ) ); |