X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Foembed.php;h=b7c1616feeab0e1f2f550b2ac41081f37d9d759a;hb=e848e376b89a6aaf35054c178c1662d4a23035fa;hp=715a0ba5bd6454445043bea6875bdad17a5fd112;hpb=94f6f12ba3a5c1d506255803e709cb640147ebf4;p=friendica.git diff --git a/include/oembed.php b/include/oembed.php old mode 100755 new mode 100644 index 715a0ba5bd..b7c1616fee --- a/include/oembed.php +++ b/include/oembed.php @@ -5,9 +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]; @@ -26,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); }