1
0
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:
camer0n
2025-01-13 15:35:28 -08:00
parent 6aa42ccad9
commit b51833b794
2 changed files with 23 additions and 7 deletions

View File

@@ -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);
}
}