From ff487a02710c2a4833c78e0b015465810c3a7987 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 1 Feb 2016 14:52:08 -0800 Subject: more oembed provider work - channel articles --- include/oembed.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/oembed.php') 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=""; -- cgit v1.2.3