summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfox <[email protected]>2018-01-18 12:40:24 +0000
committerGogs <[email protected]>2018-01-18 12:40:24 +0000
commit36eed4d7374866f314fbdac4d00b37039674239b (patch)
tree00b815cf54daddf928790b685e6940f3e74b740e
parenta421eb655da52a627ee91ae6eddcbbb3d9bc6f2d (diff)
parent32dc9ec854f9c317266584ecb33127f469d4bd80 (diff)
Merge branch 'master' of binfalse/tt-rss into master
-rw-r--r--include/functions.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/include/functions.php b/include/functions.php
index 649b77881..dfa78a8ac 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -402,8 +402,8 @@
curl_setopt($ch, CURLOPT_COOKIEJAR, "/dev/null");
}
- if (defined('_CURL_HTTP_PROXY')) {
- curl_setopt($ch, CURLOPT_PROXY, _CURL_HTTP_PROXY);
+ if (defined('_HTTP_PROXY')) {
+ curl_setopt($ch, CURLOPT_PROXY, _HTTP_PROXY);
}
if ($post_query) {
@@ -483,25 +483,25 @@
// TODO: should this support POST requests or not? idk
+ $context_options = array(
+ 'http' => array(
+ 'method' => 'GET',
+ 'ignore_errors' => true,
+ 'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
+ 'protocol_version'=> 1.1)
+ );
+
if (!$post_query && $last_modified) {
- $context = stream_context_create(array(
- 'http' => array(
- 'method' => 'GET',
- 'ignore_errors' => true,
- 'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
- 'protocol_version'=> 1.1,
- 'header' => "If-Modified-Since: $last_modified\r\n")
- ));
- } else {
- $context = stream_context_create(array(
- 'http' => array(
- 'method' => 'GET',
- 'ignore_errors' => true,
- 'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
- 'protocol_version'=> 1.1
- )));
+ $context_options['http']['header'] = "If-Modified-Since: $last_modified\r\n";
}
+ if (defined('_HTTP_PROXY')) {
+ $context_options['http']['request_fulluri'] = true;
+ $context_options['http']['proxy'] = _HTTP_PROXY;
+ }
+
+ $context = stream_context_create($context_options);
+
$old_error = error_get_last();
$data = @file_get_contents($url, false, $context);