aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-25 16:13:10 -0800
committerFriendika <info@friendika.com>2010-11-25 16:13:10 -0800
commit555c377fdac1703d640643bcedadff8d90721bec (patch)
treeac20a31e1bd09df2f426e2b86265057eb202655f /boot.php
parent041df1c011f6adeffe949eea2a6077a66437c913 (diff)
downloadvolse-hubzilla-555c377fdac1703d640643bcedadff8d90721bec.tar.gz
volse-hubzilla-555c377fdac1703d640643bcedadff8d90721bec.tar.bz2
volse-hubzilla-555c377fdac1703d640643bcedadff8d90721bec.zip
need app
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index a17f078bf..bd8ddeeaa 100644
--- a/boot.php
+++ b/boot.php
@@ -388,6 +388,9 @@ function t($s) {
if(! function_exists('fetch_url')) {
function fetch_url($url,$binary = false, &$redirects = 0) {
+
+ $a = get_app();
+
$ch = curl_init($url);
if(($redirects > 8) || (! $ch))
return false;
@@ -420,6 +423,8 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
$s = curl_exec($ch);
+// logger('Curl ' . curl_getinfo($ch,CURLINFO_HTTP_CODE));
+
$http_code = intval(curl_getinfo($ch, CURLINFO_HTTP_CODE));
$header = substr($s,0,strpos($s,"\r\n\r\n"));
if(stristr($header,'100') && (strlen($header) < 30)) {
@@ -437,7 +442,6 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
return fetch_url($url,$binary,$redirects);
}
}
- $a = get_app();
$a->set_curl_code($http_code);
$body = substr($s,strlen($header)+4);
$a->set_curl_headers($header);
@@ -450,6 +454,7 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
if(! function_exists('post_url')) {
function post_url($url,$params, $headers = null, &$redirects = 0) {
+ $a = get_app();
$ch = curl_init($url);
if(($redirects > 8) || (! $ch))
return false;
@@ -497,7 +502,6 @@ function post_url($url,$params, $headers = null, &$redirects = 0) {
return post_url($url,$binary,$headers,$redirects);
}
}
- $a = get_app();
$a->set_curl_code($http_code);
$body = substr($s,strlen($header)+4);
$a->set_curl_headers($header);