aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/oembed.php b/include/oembed.php
index 2d3e0d3f9..544803dce 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -53,6 +53,10 @@ function oembed_fetch_url($embedurl){
$a = get_app();
+ $embedurl = str_replace('&','&', $embedurl);
+
+// logger('fetch: ' . $embedurl);
+
$txt = Cache::get($a->videowidth . $embedurl);
if(strstr($txt,'youtu') && strstr(z_root(),'https:')) {
@@ -120,20 +124,29 @@ function oembed_fetch_url($embedurl){
if ($txt[0]!="{") $txt='{"type":"error"}';
//save in cache
- Cache::set($a->videowidth . $embedurl,$txt);
+
+ if(! get_config('system','oembed_cache_disable'))
+ Cache::set($a->videowidth . $embedurl,$txt);
}
$j = json_decode($txt);
$j->embedurl = $embedurl;
+
+// logger('fetch return: ' . print_r($j,true));
+
return $j;
+
+
}
function oembed_format_object($j){
$a = get_app();
$embedurl = $j->embedurl;
+// logger('format: ' . print_r($j,true));
+
$jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null));
$ret="<span class='oembed ".$j->type."'>";