X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Foembed.php;h=b7c1616feeab0e1f2f550b2ac41081f37d9d759a;hb=4224209497a6c7f723ea2b4d989f99890bccc47f;hp=cb23517cdbabbfc17b44e502437143cd05e3cc8b;hpb=e6e8ebbac5ec0b7d93c164c2ffd4c6c80fb845fc;p=friendica.git diff --git a/include/oembed.php b/include/oembed.php index cb23517cdb..b7c1616fee 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -5,8 +5,11 @@ */ use Friendica\App; +use Friendica\Core\Cache; +use Friendica\Core\System; use Friendica\ParseUrl; use Friendica\Core\Config; +use Friendica\Database\DBM; function oembed_replacecb($matches){ $embedurl=$matches[1]; @@ -25,17 +28,17 @@ function oembed_replacecb($matches){ * @return bool|object Returns object with embed content or false if no embedable * content exists */ -function oembed_fetch_url($embedurl, $no_rich_type = false){ +function oembed_fetch_url($embedurl, $no_rich_type = false) { $embedurl = trim($embedurl, "'"); $embedurl = trim($embedurl, '"'); $a = get_app(); - $r = q("SELECT * FROM `oembed` WHERE `url` = '%s'", - dbesc(normalise_link($embedurl))); + $condition = array('url' => normalise_link($embedurl)); + $r = dba::select('oembed', array('content'), $condition, array('limit' => 1)); - if (dbm::is_result($r)) { - $txt = $r[0]["content"]; + if (DBM::is_result($r)) { + $txt = $r["content"]; } else { $txt = Cache::get($a->videowidth . $embedurl); } @@ -152,7 +155,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 +252,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 ''; }