Cleanup: use safe boolean comparisons
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
parent
7418f7cb60
commit
ee6f4b64a9
4 changed files with 6 additions and 4 deletions
|
@ -122,7 +122,7 @@ function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes)
|
||||||
$content = substr($response, $headSize);
|
$content = substr($response, $headSize);
|
||||||
$headers = array();
|
$headers = array();
|
||||||
foreach (preg_split('~[\r\n]+~', $rawHeadersLastRedir) as $line) {
|
foreach (preg_split('~[\r\n]+~', $rawHeadersLastRedir) as $line) {
|
||||||
if (empty($line) or ctype_space($line)) {
|
if (empty($line) || ctype_space($line)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$splitLine = explode(': ', $line, 2);
|
$splitLine = explode(': ', $line, 2);
|
||||||
|
|
|
@ -89,7 +89,9 @@ function count_private($links)
|
||||||
{
|
{
|
||||||
$cpt = 0;
|
$cpt = 0;
|
||||||
foreach ($links as $link) {
|
foreach ($links as $link) {
|
||||||
$cpt = $link['private'] == true ? $cpt + 1 : $cpt;
|
if ($link['private']) {
|
||||||
|
$cpt += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $cpt;
|
return $cpt;
|
||||||
|
|
|
@ -69,7 +69,7 @@ public function update()
|
||||||
return $updatesRan;
|
return $updatesRan;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->methods == null) {
|
if ($this->methods === null) {
|
||||||
throw new UpdaterException('Couldn\'t retrieve Updater class methods.');
|
throw new UpdaterException('Couldn\'t retrieve Updater class methods.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 session does not exist on server side, or IP address has changed, or session has expired, logout.
|
||||||
if (empty($_SESSION['uid'])
|
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'])
|
|| time() >= $_SESSION['expires_on'])
|
||||||
{
|
{
|
||||||
logout();
|
logout();
|
||||||
|
|
Loading…
Reference in a new issue