aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-11-18 22:04:41 -0800
committerfriendica <info@friendica.com>2011-11-18 22:04:41 -0800
commitfd4fe24406edb277814c7a45a6094a8eec0850d7 (patch)
tree7db5bceb30a569b035c600313a9dbbf66b14abac /include/network.php
parent485f97b3d8937f219e2b9f3c662ee0e1966130eb (diff)
parent6893df991edfe971871a5db45055b40b871a7a4f (diff)
downloadvolse-hubzilla-fd4fe24406edb277814c7a45a6094a8eec0850d7.tar.gz
volse-hubzilla-fd4fe24406edb277814c7a45a6094a8eec0850d7.tar.bz2
volse-hubzilla-fd4fe24406edb277814c7a45a6094a8eec0850d7.zip
Merge branch 'master' into groups
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/network.php b/include/network.php
index a9ee3f0a5..78ed24074 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,8 +14,16 @@ 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");
+ @curl_setopt($ch, CURLOPT_USERAGENT, "Friendica");
+
if(intval($timeout)) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
@@ -97,7 +105,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0)
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
- curl_setopt($ch, CURLOPT_USERAGENT, "Friendika");
+ curl_setopt($ch, CURLOPT_USERAGENT, "Friendica");
if(intval($timeout)) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);