aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-03-08 09:39:46 +0100
committerMario Vavti <mario@mariovavti.com>2017-03-08 09:39:46 +0100
commitbc2b948f1f6e62b1c277a4042200bb6678956f3f (patch)
tree8586c30e495607eee23f16c0aad40974f0711275 /include/oembed.php
parent23e3e2c50499fab52769929a448e73012fd915af (diff)
parentff9442474d07cce24c8f66db39ec34471c3874a2 (diff)
downloadvolse-hubzilla-2.2.tar.gz
volse-hubzilla-2.2.tar.bz2
volse-hubzilla-2.2.zip
Merge branch 2.2RC2.2
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php17
1 files changed, 5 insertions, 12 deletions
diff --git a/include/oembed.php b/include/oembed.php
index 8c78e2807..aac7d15b4 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -2,8 +2,6 @@
use Zotlabs\Lib as Zlib;
-require_once('include/hubloc.php');
-
function oembed_replacecb($matches){
@@ -107,7 +105,7 @@ function oembed_action($embedurl) {
function oembed_process($url) {
$j = oembed_fetch_url($url);
- logger('oembed_process: ' . print_r($j,true));
+ logger('oembed_process: ' . print_r($j,true), LOGGER_DATA, LOG_DEBUG);
if($j && $j['type'] !== 'error')
return '[embed]' . $url . '[/embed]';
return false;
@@ -138,19 +136,15 @@ function oembed_fetch_url($embedurl){
// we should try to cache this and avoid a lookup on each render
$zrl = is_matrix_url($embedurl);
+ $furl = ((local_channel() && $zrl) ? zid($embedurl) : $embedurl);
+
if($action !== 'block') {
- $txt = Zlib\Cache::get('[' . App::$videowidth . '] ' . $embedurl);
+ $txt = Zlib\Cache::get('[' . App::$videowidth . '] ' . $furl);
}
if(is_null($txt)) {
$txt = "";
- $furl = $embedurl;
-
- logger('local_channel: ' . local_channel());
-
- if(local_channel() && $zrl)
- $furl = zid($furl);
if ($action !== 'block') {
// try oembed autodiscovery
@@ -209,11 +203,10 @@ function oembed_fetch_url($embedurl){
//save in cache
if(! get_config('system','oembed_cache_disable'))
- Zlib\Cache::set('[' . App::$videowidth . '] ' . $embedurl,$txt);
+ Zlib\Cache::set('[' . App::$videowidth . '] ' . $furl, $txt);
}
-
$j = json_decode($txt,true);
if(! $j)