Cleanup: use safe boolean comparisons

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
VirtualTam 2017-01-06 18:54:29 +01:00 committed by VirtualTam
parent 7418f7cb60
commit ee6f4b64a9
4 changed files with 6 additions and 4 deletions

View file

@ -122,7 +122,7 @@ function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes)
$content = substr($response, $headSize);
$headers = array();
foreach (preg_split('~[\r\n]+~', $rawHeadersLastRedir) as $line) {
if (empty($line) or ctype_space($line)) {
if (empty($line) || ctype_space($line)) {
continue;
}
$splitLine = explode(': ', $line, 2);

View file

@ -89,7 +89,9 @@ function count_private($links)
{
$cpt = 0;
foreach ($links as $link) {
$cpt = $link['private'] == true ? $cpt + 1 : $cpt;
if ($link['private']) {
$cpt += 1;
}
}
return $cpt;

View file

@ -69,7 +69,7 @@ public function update()
return $updatesRan;
}
if ($this->methods == null) {
if ($this->methods === null) {
throw new UpdaterException('Couldn\'t retrieve Updater class methods.');
}

View file

@ -204,7 +204,7 @@ function setup_login_state($conf)
}
// If session does not exist on server side, or IP address has changed, or session has expired, logout.
if (empty($_SESSION['uid'])
|| ($conf->get('security.session_protection_disabled') == false && $_SESSION['ip'] != allIPs())
|| ($conf->get('security.session_protection_disabled') === false && $_SESSION['ip'] != allIPs())
|| time() >= $_SESSION['expires_on'])
{
logout();