diff options
author | redmatrix <git@macgirvin.com> | 2016-02-01 14:52:08 -0800 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-02-01 14:52:08 -0800 |
commit | ff487a02710c2a4833c78e0b015465810c3a7987 (patch) | |
tree | 9330f616788c213593f5b868f1bf878ba8077b06 /include/oembed.php | |
parent | 01b5b1347521951ca78b1718b03c45897800bf5e (diff) | |
download | volse-hubzilla-ff487a02710c2a4833c78e0b015465810c3a7987.tar.gz volse-hubzilla-ff487a02710c2a4833c78e0b015465810c3a7987.tar.bz2 volse-hubzilla-ff487a02710c2a4833c78e0b015465810c3a7987.zip |
more oembed provider work - channel articles
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-x | include/oembed.php | 15 |
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."'>"; |