From 9430117204cdd55581bff52bda71f33db796aae9 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Feb 2013 20:13:30 -0800 Subject: route oembed through z_fetch_url --- include/oembed.php | 10 ++++++++-- 1 file 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); -- cgit v1.2.3