]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/OEmbed.php
Several more warnings ... (#5340)
[friendica.git] / src / Content / OEmbed.php
index 2a9db64882a2fa902948517bf808e99de2507bb1..360a0dc4899439949d7addf0de0b99bcf088d469 100644 (file)
@@ -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);
                                }