diff options
author | VirtualTam <virtualtam@flibidi.net> | 2017-01-06 18:54:29 +0100 |
---|---|---|
committer | VirtualTam <virtualtam+github@flibidi.net> | 2017-01-07 14:37:40 +0100 |
commit | ee6f4b64a91d76070f930cdf7602ab4686714c7a (patch) | |
tree | 29056ef186c14a08d9ce7e1aa7514fa98bd2197e /application | |
parent | 7418f7cb60524c3bfc2f240386b5e3e7eb9b3257 (diff) | |
download | Shaarli-ee6f4b64a91d76070f930cdf7602ab4686714c7a.tar.gz Shaarli-ee6f4b64a91d76070f930cdf7602ab4686714c7a.tar.zst Shaarli-ee6f4b64a91d76070f930cdf7602ab4686714c7a.zip |
Cleanup: use safe boolean comparisons
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'application')
-rw-r--r-- | application/HttpUtils.php | 2 | ||||
-rw-r--r-- | application/LinkUtils.php | 4 | ||||
-rw-r--r-- | application/Updater.php | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/application/HttpUtils.php b/application/HttpUtils.php index e8fc1f5d..a81f9056 100644 --- a/application/HttpUtils.php +++ b/application/HttpUtils.php | |||
@@ -122,7 +122,7 @@ function get_http_response($url, $timeout = 30, $maxBytes = 4194304) | |||
122 | $content = substr($response, $headSize); | 122 | $content = substr($response, $headSize); |
123 | $headers = array(); | 123 | $headers = array(); |
124 | foreach (preg_split('~[\r\n]+~', $rawHeadersLastRedir) as $line) { | 124 | foreach (preg_split('~[\r\n]+~', $rawHeadersLastRedir) as $line) { |
125 | if (empty($line) or ctype_space($line)) { | 125 | if (empty($line) || ctype_space($line)) { |
126 | continue; | 126 | continue; |
127 | } | 127 | } |
128 | $splitLine = explode(': ', $line, 2); | 128 | $splitLine = explode(': ', $line, 2); |
diff --git a/application/LinkUtils.php b/application/LinkUtils.php index cf58f808..976474de 100644 --- a/application/LinkUtils.php +++ b/application/LinkUtils.php | |||
@@ -89,7 +89,9 @@ function count_private($links) | |||
89 | { | 89 | { |
90 | $cpt = 0; | 90 | $cpt = 0; |
91 | foreach ($links as $link) { | 91 | foreach ($links as $link) { |
92 | $cpt = $link['private'] == true ? $cpt + 1 : $cpt; | 92 | if ($link['private']) { |
93 | $cpt += 1; | ||
94 | } | ||
93 | } | 95 | } |
94 | 96 | ||
95 | return $cpt; | 97 | return $cpt; |
diff --git a/application/Updater.php b/application/Updater.php index 621c7238..704ce7ab 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -69,7 +69,7 @@ class Updater | |||
69 | return $updatesRan; | 69 | return $updatesRan; |
70 | } | 70 | } |
71 | 71 | ||
72 | if ($this->methods == null) { | 72 | if ($this->methods === null) { |
73 | throw new UpdaterException('Couldn\'t retrieve Updater class methods.'); | 73 | throw new UpdaterException('Couldn\'t retrieve Updater class methods.'); |
74 | } | 74 | } |
75 | 75 | ||