diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2011-11-17 04:53:22 -0800 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2011-11-17 04:53:22 -0800 |
commit | 32f17e7e24d52bed1b5a5d8ed01d101522b26a9f (patch) | |
tree | 3ba5f23865643ff8c660fb9c9a9eeb44327b8a1b /include/network.php | |
parent | c9846b745dfe2a4c20ffe4e1f48bb18da3886fd4 (diff) | |
parent | 844a36e2b6c9cd8e934b57b7d56b7a9863f12929 (diff) | |
download | volse-hubzilla-32f17e7e24d52bed1b5a5d8ed01d101522b26a9f.tar.gz volse-hubzilla-32f17e7e24d52bed1b5a5d8ed01d101522b26a9f.tar.bz2 volse-hubzilla-32f17e7e24d52bed1b5a5d8ed01d101522b26a9f.zip |
Merge pull request #7 from fabrixxm/master
Fix possibile fatal error with oembed
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/network.php b/include/network.php index a9ee3f0a5..e89eb94da 100644 --- a/include/network.php +++ b/include/network.php @@ -5,7 +5,7 @@ // results. if(! function_exists('fetch_url')) { -function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0) { +function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_content=Null) { $a = get_app(); @@ -14,9 +14,17 @@ function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0) { return false; @curl_setopt($ch, CURLOPT_HEADER, true); + + if (!is_null($accept_content)){ + curl_setopt($ch,CURLOPT_HTTPHEADER, array ( + "Accept: "+$accept_content + )); + } + @curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); @curl_setopt($ch, CURLOPT_USERAGENT, "Friendika"); + if(intval($timeout)) { @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); } |