aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-04-19 20:48:10 -0700
committerzotlabs <mike@macgirvin.com>2017-04-19 20:48:10 -0700
commitf52c670c05b01610f60e736c44c81e5b6f9f7ceb (patch)
treedd203c496b9d4ba6caa96e5ef720389852db3dbb /include/oembed.php
parentf3adc8d7383a081e0e4d06db0874f422c7baa838 (diff)
downloadvolse-hubzilla-f52c670c05b01610f60e736c44c81e5b6f9f7ceb.tar.gz
volse-hubzilla-f52c670c05b01610f60e736c44c81e5b6f9f7ceb.tar.bz2
volse-hubzilla-f52c670c05b01610f60e736c44c81e5b6f9f7ceb.zip
support reverse magic-auth in oembed requests.
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php11
1 files changed, 9 insertions, 2 deletions
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);