diff options
author | friendica <info@friendica.com> | 2013-02-25 20:13:30 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-02-25 20:13:30 -0800 |
commit | 9430117204cdd55581bff52bda71f33db796aae9 (patch) | |
tree | 40983a2841e02e817a8b332757157c91de71c31c | |
parent | c45a8e27638592fc89826097efe07ded31f3c50a (diff) | |
download | volse-hubzilla-9430117204cdd55581bff52bda71f33db796aae9.tar.gz volse-hubzilla-9430117204cdd55581bff52bda71f33db796aae9.tar.bz2 volse-hubzilla-9430117204cdd55581bff52bda71f33db796aae9.zip |
route oembed through z_fetch_url
-rwxr-xr-x | include/oembed.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/oembed.php b/include/oembed.php index 7ef6d561f..ddb8644a3 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -29,7 +29,11 @@ function oembed_fetch_url($embedurl){ if (!in_array($ext, $noexts)){ // try oembed autodiscovery $redirects = 0; - $html_text = fetch_url($embedurl, false, $redirects, 15, "text/*"); + + $result = z_fetch_url($embedurl, false, $redirects, array('timeout' => 15, 'accept_content' => "text/*")); + if($result['success']) + $html_text = $result['body']; + if($html_text){ $dom = @DOMDocument::loadHTML($html_text); if ($dom){ @@ -50,7 +54,9 @@ function oembed_fetch_url($embedurl){ if ($txt==false || $txt==""){ // try oohembed service $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl).'&maxwidth=' . $a->videowidth; - $txt = fetch_url($ourl); + $result = z_fetch_url($ourl); + if($result['success']) + $txt = $result['body']; } $txt=trim($txt); |