Use default value
use the default value parameter correctly!
This commit is contained in:
parent
3e5a518591
commit
71911a6989
2 changed files with 6 additions and 8 deletions
|
@ -126,9 +126,8 @@ function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array())
|
||||||
if (x($opts, 'timeout')) {
|
if (x($opts, 'timeout')) {
|
||||||
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
|
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
|
||||||
} else {
|
} else {
|
||||||
// if Config::get returns null, intval will be 0 which will also evaluate to false
|
$curl_time = Config::get('system', 'curl_timeout', 60);
|
||||||
$curl_time = intval(Config::get('system', 'curl_timeout'));
|
@curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time));
|
||||||
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// by default we will allow self-signed certs
|
// by default we will allow self-signed certs
|
||||||
|
@ -303,9 +302,8 @@ function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0)
|
||||||
if (intval($timeout)) {
|
if (intval($timeout)) {
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
||||||
} else {
|
} else {
|
||||||
// if Config::get returns null, intval will be 0 which will also evaluate to false
|
$curl_time = Config::get('system', 'curl_timeout', 60);
|
||||||
$curl_time = intval(Config::get('system', 'curl_timeout'));
|
curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time));
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('LIGHTTPD')) {
|
if (defined('LIGHTTPD')) {
|
||||||
|
|
|
@ -91,8 +91,8 @@ Class OnePoll
|
||||||
$t = $contact['last-update'];
|
$t = $contact['last-update'];
|
||||||
|
|
||||||
if ($contact['subhub']) {
|
if ($contact['subhub']) {
|
||||||
$poll_interval = Config::get('system', 'pushpoll_frequency');
|
$poll_interval = Config::get('system', 'pushpoll_frequency', 3);
|
||||||
$contact['priority'] = ((!is_null($poll_interval)) ? intval($poll_interval) : 3);
|
$contact['priority'] = intval($poll_interval);
|
||||||
$hub_update = false;
|
$hub_update = false;
|
||||||
|
|
||||||
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 day")) {
|
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 day")) {
|
||||||
|
|
Loading…
Reference in a new issue