mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Download limit for fetching data via "z_fetch_url"
This commit is contained in:
parent
f880fb9a42
commit
a2debaa68a
5 changed files with 136 additions and 128 deletions
|
@ -4,6 +4,9 @@
|
|||
* @file include/network.php
|
||||
*/
|
||||
|
||||
use \Friendica\Core\Config;
|
||||
use \Friendica\Core\PConfig;
|
||||
|
||||
require_once("include/xml.php");
|
||||
require_once('include/Probe.php');
|
||||
|
||||
|
@ -93,7 +96,10 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
|
|||
@curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
|
||||
@curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
|
||||
|
||||
$range = intval(Config::get('system', 'curl_range_bytes', 0));
|
||||
if ($range > 0) {
|
||||
@curl_setopt($ch, CURLOPT_RANGE, '0-'.$range);
|
||||
}
|
||||
|
||||
if(x($opts,'headers')){
|
||||
@curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue