@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | * @return bool |
118 | 118 | */ |
119 | 119 | private function isUrandomAvailable() { |
120 | - if(@file_exists('/dev/urandom')) { |
|
120 | + if (@file_exists('/dev/urandom')) { |
|
121 | 121 | $file = fopen('/dev/urandom', 'rb'); |
122 | - if($file) { |
|
122 | + if ($file) { |
|
123 | 123 | fclose($file); |
124 | 124 | return true; |
125 | 125 | } |
@@ -156,40 +156,40 @@ discard block |
||
156 | 156 | // Don't run check when: |
157 | 157 | // 1. Server has `has_internet_connection` set to false |
158 | 158 | // 2. AppStore AND S2S is disabled |
159 | - if(!$this->config->getSystemValue('has_internet_connection', true)) { |
|
159 | + if (!$this->config->getSystemValue('has_internet_connection', true)) { |
|
160 | 160 | return ''; |
161 | 161 | } |
162 | - if(!$this->config->getSystemValue('appstoreenabled', $appStoreDefault) |
|
162 | + if (!$this->config->getSystemValue('appstoreenabled', $appStoreDefault) |
|
163 | 163 | && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no' |
164 | 164 | && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') { |
165 | 165 | return ''; |
166 | 166 | } |
167 | 167 | |
168 | 168 | $versionString = $this->getCurlVersion(); |
169 | - if(isset($versionString['ssl_version'])) { |
|
169 | + if (isset($versionString['ssl_version'])) { |
|
170 | 170 | $versionString = $versionString['ssl_version']; |
171 | 171 | } else { |
172 | 172 | return ''; |
173 | 173 | } |
174 | 174 | |
175 | - $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
176 | - if(!$this->config->getSystemValue('appstoreenabled', $appStoreDefault)) { |
|
177 | - $features = (string)$this->l10n->t('Federated Cloud Sharing'); |
|
175 | + $features = (string) $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
176 | + if (!$this->config->getSystemValue('appstoreenabled', $appStoreDefault)) { |
|
177 | + $features = (string) $this->l10n->t('Federated Cloud Sharing'); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | // Check if at least OpenSSL after 1.01d or 1.0.2b |
181 | - if(strpos($versionString, 'OpenSSL/') === 0) { |
|
181 | + if (strpos($versionString, 'OpenSSL/') === 0) { |
|
182 | 182 | $majorVersion = substr($versionString, 8, 5); |
183 | 183 | $patchRelease = substr($versionString, 13, 6); |
184 | 184 | |
185 | - if(($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
185 | + if (($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
186 | 186 | ($majorVersion === '1.0.2' && ord($patchRelease) < ord('b'))) { |
187 | 187 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['OpenSSL', $versionString, $features]); |
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | 191 | // Check if NSS and perform heuristic check |
192 | - if(strpos($versionString, 'NSS/') === 0) { |
|
192 | + if (strpos($versionString, 'NSS/') === 0) { |
|
193 | 193 | try { |
194 | 194 | $firstClient = $this->clientService->newClient(); |
195 | 195 | $firstClient->get('https://nextcloud.com/'); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $secondClient = $this->clientService->newClient(); |
198 | 198 | $secondClient->get('https://nextcloud.com/'); |
199 | 199 | } catch (ClientException $e) { |
200 | - if($e->getResponse()->getStatusCode() === 400) { |
|
200 | + if ($e->getResponse()->getStatusCode() === 400) { |
|
201 | 201 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['NSS', $versionString, $features]); |
202 | 202 | } |
203 | 203 | } |
@@ -277,13 +277,13 @@ discard block |
||
277 | 277 | * @return DataResponse |
278 | 278 | */ |
279 | 279 | public function getFailedIntegrityCheckFiles() { |
280 | - if(!$this->checker->isCodeCheckEnforced()) { |
|
280 | + if (!$this->checker->isCodeCheckEnforced()) { |
|
281 | 281 | return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); |
282 | 282 | } |
283 | 283 | |
284 | 284 | $completeResults = $this->checker->getResults(); |
285 | 285 | |
286 | - if(!empty($completeResults)) { |
|
286 | + if (!empty($completeResults)) { |
|
287 | 287 | $formattedTextResponse = 'Technical information |
288 | 288 | ===================== |
289 | 289 | The following list covers which files have failed the integrity check. Please read |
@@ -293,12 +293,12 @@ discard block |
||
293 | 293 | Results |
294 | 294 | ======= |
295 | 295 | '; |
296 | - foreach($completeResults as $context => $contextResult) { |
|
296 | + foreach ($completeResults as $context => $contextResult) { |
|
297 | 297 | $formattedTextResponse .= "- $context\n"; |
298 | 298 | |
299 | - foreach($contextResult as $category => $result) { |
|
299 | + foreach ($contextResult as $category => $result) { |
|
300 | 300 | $formattedTextResponse .= "\t- $category\n"; |
301 | - if($category !== 'EXCEPTION') { |
|
301 | + if ($category !== 'EXCEPTION') { |
|
302 | 302 | foreach ($result as $key => $results) { |
303 | 303 | $formattedTextResponse .= "\t\t- $key\n"; |
304 | 304 | } |