X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FOEmbed.php;h=360a0dc4899439949d7addf0de0b99bcf088d469;hb=0360f7197aac062eb2fecf95969658ca56068deb;hp=2a9db64882a2fa902948517bf808e99de2507bb1;hpb=8aff8a76eb9efc4acaab0af3c8c0ca7a011f4349;p=friendica.git diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 2a9db64882..360a0dc489 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -11,9 +11,9 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Database\DBM; +use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\ParseUrl; -use Friendica\Util\Temporal; use dba; use DOMDocument; use DOMNode; @@ -108,12 +108,12 @@ class OEmbed $txt = '{"type":"error"}'; } else { //save in cache $j = json_decode($txt); - if ($j->type != "error") { + if (!empty($j->type) && $j->type != "error") { dba::insert('oembed', [ 'url' => normalise_link($embedurl), 'maxwidth' => $a->videowidth, 'content' => $txt, - 'created' => Temporal::utcNow() + 'created' => DateTimeFormat::utcNow() ], true); }