Skip to content

Commit ea119a3

Browse files
Using mime_content_type for image mime detecting
1 parent c10caea commit ea119a3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/VCard.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,7 @@ private function addMedia($property, $url, $include = true, $element)
215215
}
216216

217217
$value = base64_encode($value);
218-
219-
$finfo = finfo_open(FILEINFO_MIME_TYPE);
220-
$mimetype = finfo_file($finfo, 'data://application/octet-stream;base64,' . $value);
221-
finfo_close($finfo);
218+
$mimetype = mime_content_type($url);
222219

223220
if (preg_match('/^image\//', $mimetype) !== 1) {
224221
throw new VCardMediaException('Returned data aren\'t an image.');

0 commit comments

Comments
 (0)