X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FOEmbed.php;h=360a0dc4899439949d7addf0de0b99bcf088d469;hb=0360f7197aac062eb2fecf95969658ca56068deb;hp=4ff353fa9459fbf13ae7ba1ce1d08926ee27aea4;hpb=dc366bf1f7b5b7b0fc1c1a86772783074b301993;p=friendica.git diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 4ff353fa94..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::convert() + 'created' => DateTimeFormat::utcNow() ], true); }