=== false and !== false to is_null where appropriate.
// delete the config entry to try again.
$t = Config::get('database', 'update_' . $x);
- if ($t !== false) {
+ if (!is_null($t)) {
return false;
}
Config::set('database', 'update_' . $x, time());
// Provide a banner/logo/whatever
$banner = Config::get('system', 'banner');
- if ($banner === false) {
+ if (is_null($banner)) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
if (x($opts, 'timeout')) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
} else {
+ // if Config::get returns null, intval will be 0 which will also evaluate to false
$curl_time = intval(Config::get('system', 'curl_timeout'));
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
}
if (intval($timeout)) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
} else {
+ // if Config::get returns null, intval will be 0 which will also evaluate to false
$curl_time = intval(Config::get('system', 'curl_timeout'));
curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
}
{
$x = Config::get('feature_lock', $feature, false);
- if ($x === false) {
+ if (is_null($x)) {
$x = PConfig::get($uid, 'feature', $feature, false);
}
- if ($x === false) {
+
+ if (is_null($x)) {
$x = Config::get('feature', $feature, false);
}
- if ($x === false) {
+
+ if (is_null($x)) {
$x = self::getDefault($feature);
}
dba::delete('tokens', array('id' => $token->key));
- if (!is_null($ret) && $uverifier !== false) {
+ if (!is_null($ret) && !is_null($uverifier)) {
Config::delete("oauth", $verifier);
}
if ($contact['subhub']) {
$poll_interval = Config::get('system', 'pushpoll_frequency');
- $contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
+ $contact['priority'] = ((!is_null($poll_interval)) ? intval($poll_interval) : 3);
$hub_update = false;
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 day")) {
function get_vier_config($key, $default = false, $admin = false) {
if (local_user() && !$admin) {
$result = PConfig::get(local_user(), "vier", $key);
- if ($result !== false) {
+ if (!is_null($result)) {
return $result;
}
}
$result = Config::get("vier", $key);
- if ($result !== false) {
+ if (!is_null($result)) {
return $result;
}