PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.19
ووسلام – همگام سازی ووکامرس و باسلام v1.10.19
1.10.19 1.10.20 1.10.18 1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 1.8.5 1.8.6 All 53 releases
← All changes | includes/Services/MediaUploadService.php +1 -13 1.10.31.10.19 View file →
@@ -135,21 +135,9 @@
135 135 }
136 136
137 137 private function detectMimeType(string $filePath): string
138 138 {
139 - $fileType = wp_check_filetype($filePath);
140 - if (!empty($fileType['type'])) return (string) $fileType['type'];
141 -
142 - if (function_exists('finfo_open')) {
143 - $finfo = finfo_open(FILEINFO_MIME_TYPE);
144 - if ($finfo) {
145 - $mimeType = finfo_file($finfo, $filePath);
146 - finfo_close($finfo);
147 - if (is_string($mimeType) && $mimeType !== '') return $mimeType;
148 - }
149 - }
150 -
151 - return 'application/octet-stream';
139 + return MediaMimeType::detect($filePath);
152 140 }
153 141
154 142 private function decodeBody($body): array
155 143 {