aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-08-31 09:41:07 +0200
committerMario Vavti <mario@mariovavti.com>2016-08-31 09:41:07 +0200
commite9462ba14529b7172ba5a21e7985d24de91faa37 (patch)
treec2270ca2975f6683a361c5959894b6bbc954475d /include/oembed.php
parent2b9322fc7d879fecbe334083bbd028538c985c54 (diff)
parentb775a1aa0e36a74f0f937d85f458fd12af18a264 (diff)
downloadvolse-hubzilla-e9462ba14529b7172ba5a21e7985d24de91faa37.tar.gz
volse-hubzilla-e9462ba14529b7172ba5a21e7985d24de91faa37.tar.bz2
volse-hubzilla-e9462ba14529b7172ba5a21e7985d24de91faa37.zip
resolve merge conflict
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/oembed.php b/include/oembed.php
index fe6f10d71..085637a00 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -156,9 +156,12 @@ function oembed_fetch_url($embedurl){
if ($action !== 'block') {
// try oembed autodiscovery
$redirects = 0;
- $result = z_fetch_url($furl, false, $redirects, array('timeout' => 15, 'accept_content' => "text/*", 'novalidate' => true ));
+ $result = z_fetch_url($furl, false, $redirects, array('timeout' => 30, 'accept_content' => "text/*", 'novalidate' => true ));
+
if($result['success'])
$html_text = $result['body'];
+ else
+ logger('fetch failure: ' . $furl);
if($html_text) {
$dom = @DOMDocument::loadHTML($html_text);
@@ -171,7 +174,10 @@ function oembed_fetch_url($embedurl){
foreach($entries as $e){
$href = $e->getAttributeNode("href")->nodeValue;
$x = z_fetch_url($href . '&maxwidth=' . App::$videowidth);
- $txt = $x['body'];
+ if($x['success'])
+ $txt = $x['body'];
+ else
+ logger('fetch failed: ' . $href);
break;
}
// soundcloud is now using text/json+oembed instead of application/json+oembed,
@@ -180,7 +186,10 @@ function oembed_fetch_url($embedurl){
foreach($entries as $e){
$href = $e->getAttributeNode("href")->nodeValue;
$x = z_fetch_url($href . '&maxwidth=' . App::$videowidth);
- $txt = $x['body'];
+ if($x['success'])
+ $txt = $x['body'];
+ else
+ logger('json fetch failed: ' . $href);
break;
}
}