]> git.mxchange.org Git - friendica.git/blobdiff - include/oembed.php
Merge pull request #3868 from rabuzarus/20171104_-_use_best_link_url_for_events
[friendica.git] / include / oembed.php
index de597bbb37ab91bfe9604b01683b0c9dbb80d3ba..715a0ba5bd6454445043bea6875bdad17a5fd112 100755 (executable)
@@ -5,6 +5,7 @@
  */
 
 use Friendica\App;
+use Friendica\Core\System;
 use Friendica\ParseUrl;
 use Friendica\Core\Config;
 
@@ -83,7 +84,7 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
                        $j = json_decode($txt);
                        if ($j->type != "error") {
                                dba::insert('oembed', array('url' => normalise_link($embedurl),
-                                                       'content' => $txt, 'created' => datetime_convert()));
+                                                       'content' => $txt, 'created' => datetime_convert()), true);
                        }
 
                        Cache::set($a->videowidth.$embedurl, $txt, CACHE_DAY);
@@ -152,7 +153,7 @@ function oembed_format_object($j){
                                $th=120; $tw = $th*$tr;
                                $tpl=get_markup_template('oembed_video.tpl');
                                $ret.=replace_macros($tpl, array(
-                                       '$baseurl'     => App::get_baseurl(),
+                                       '$baseurl'     => System::baseUrl(),
                                        '$embedurl'    => $embedurl,
                                        '$escapedhtml' => base64_encode($jhtml),
                                        '$tw'          => $tw,
@@ -249,7 +250,7 @@ function oembed_iframe($src, $width, $height) {
        }
        $width = '100%';
 
-       $s = App::get_baseurl() . '/oembed/' . base64url_encode($src);
+       $s = System::baseUrl() . '/oembed/' . base64url_encode($src);
        return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $s . '" allowfullscreen scrolling="no" frameborder="no">' . t('Embedded content') . '</iframe>';
 }