From f52c670c05b01610f60e736c44c81e5b6f9f7ceb Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 19 Apr 2017 20:48:10 -0700 Subject: support reverse magic-auth in oembed requests. --- include/oembed.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/oembed.php b/include/oembed.php index aac7d15b4..5865c95d5 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -149,7 +149,14 @@ function oembed_fetch_url($embedurl){ if ($action !== 'block') { // try oembed autodiscovery $redirects = 0; - $result = z_fetch_url($furl, false, $redirects, array('timeout' => 30, 'accept_content' => "text/*", 'novalidate' => true )); + $result = z_fetch_url($furl, false, $redirects, + [ + 'timeout' => 30, + 'accept_content' => "text/*", + 'novalidate' => true, + 'session' => ((local_channel() && $zrl) ? true : false) + ] + ); if($result['success']) $html_text = $result['body']; @@ -200,7 +207,7 @@ function oembed_fetch_url($embedurl){ if ($txt[0]!="{") $txt='{"type":"error"}'; - //save in cache + // save in cache if(! get_config('system','oembed_cache_disable')) Zlib\Cache::set('[' . App::$videowidth . '] ' . $furl, $txt); -- cgit v1.2.3