mirror of
https://github.com/e107inc/e107.git
synced 2025-08-12 09:34:54 +02:00
Fixes #5387 - Avatar mime type on remote image.
This commit is contained in:
@@ -4395,10 +4395,18 @@ class e_parse
|
||||
|
||||
if (!empty($options['base64'])) // embed image data into URL.
|
||||
{
|
||||
$content = e107::getFile()->getRemoteContent($url); // returns false during unit tests, works otherwise.
|
||||
$content = e107::getFile()->getRemoteContent($url);
|
||||
if (!empty($content))
|
||||
{
|
||||
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
||||
if(!empty($file))
|
||||
{
|
||||
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
||||
}
|
||||
else
|
||||
{
|
||||
$ext = strtolower(pathinfo($url, PATHINFO_EXTENSION));
|
||||
}
|
||||
|
||||
$url = 'data:image/' . $ext . ';base64,' . base64_encode($content);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user