Use base64 instead of .ico favicon
This commit is contained in:
parent
37033d70d9
commit
90e87c6a50
1 changed files with 5 additions and 1 deletions
|
@ -37,7 +37,7 @@ class EmbedCache
|
||||||
|
|
||||||
public function get(bool $generateCache = false): \stdClass
|
public function get(bool $generateCache = false): \stdClass
|
||||||
{
|
{
|
||||||
$info = null;
|
$info = null;
|
||||||
|
|
||||||
if (!$this->generateCache() && false === $generateCache) {
|
if (!$this->generateCache() && false === $generateCache) {
|
||||||
$info = json_decode(file_get_contents($this->getFilepath()));
|
$info = json_decode(file_get_contents($this->getFilepath()));
|
||||||
|
@ -91,6 +91,10 @@ class EmbedCache
|
||||||
$info_simplified->title = (string) $info->title;
|
$info_simplified->title = (string) $info->title;
|
||||||
$info_simplified->url = (string) $info->url;
|
$info_simplified->url = (string) $info->url;
|
||||||
|
|
||||||
|
if (str_contains(pathinfo($info->favicon, PATHINFO_EXTENSION), 'ico')) {
|
||||||
|
$info_simplified->favicon = 'data:image/x-icon;base64,' . base64_encode(file_get_contents($info_simplified->favicon));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
} catch (\Throwable $ex) {
|
} catch (\Throwable $ex) {
|
||||||
$generateCache = false;
|
$generateCache = false;
|
||||||
|
|
Loading…
Reference in a new issue