mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Issue #5387 Tweak for tests.
This commit is contained in:
@@ -4395,18 +4395,21 @@ class e_parse
|
|||||||
|
|
||||||
if (!empty($options['base64'])) // embed image data into URL.
|
if (!empty($options['base64'])) // embed image data into URL.
|
||||||
{
|
{
|
||||||
$content = e107::getFile()->getRemoteContent($url);
|
$content = '';
|
||||||
|
|
||||||
|
if(!empty($file))
|
||||||
|
{
|
||||||
|
$content = file_get_contents($file);
|
||||||
|
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$content = e107::getFile()->getRemoteContent($url);
|
||||||
|
$ext = strtolower(pathinfo($url, PATHINFO_EXTENSION));
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($content))
|
if (!empty($content))
|
||||||
{
|
{
|
||||||
if(!empty($file))
|
|
||||||
{
|
|
||||||
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$ext = strtolower(pathinfo($url, PATHINFO_EXTENSION));
|
|
||||||
}
|
|
||||||
|
|
||||||
$url = 'data:image/' . $ext . ';base64,' . base64_encode($content);
|
$url = 'data:image/' . $ext . ';base64,' . base64_encode($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user