Completed
Push — master ( 44adca...ee4262 )
by Lukas
15:07
created
lib/private/Security/Bruteforce/Throttler.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	private function getCutoff($expire) {
83 83
 		$d1 = new \DateTime();
84 84
 		$d2 = clone $d1;
85
-		$d2->sub(new \DateInterval('PT' . $expire . 'S'));
85
+		$d2->sub(new \DateInterval('PT'.$expire.'S'));
86 86
 		return $d2->diff($d1);
87 87
 	}
88 88
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 									$ip,
99 99
 									array $metadata = []) {
100 100
 		// No need to log if the bruteforce protection is disabled
101
-		if($this->config->getSystemValue('auth.bruteforce.protection.enabled', true) === false) {
101
+		if ($this->config->getSystemValue('auth.bruteforce.protection.enabled', true) === false) {
102 102
 			return;
103 103
 		}
104 104
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		$values = [
107 107
 			'action' => $action,
108 108
 			'occurred' => $this->timeFactory->getTime(),
109
-			'ip' => (string)$ipAddress,
109
+			'ip' => (string) $ipAddress,
110 110
 			'subnet' => $ipAddress->getSubnet(),
111 111
 			'metadata' => json_encode($metadata),
112 112
 		];
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
 		$qb = $this->db->getQueryBuilder();
126 126
 		$qb->insert('bruteforce_attempts');
127
-		foreach($values as $column => $value) {
127
+		foreach ($values as $column => $value) {
128 128
 			$qb->setValue($column, $qb->createNamedParameter($value));
129 129
 		}
130 130
 		$qb->execute();
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @return bool
138 138
 	 */
139 139
 	private function isIPWhitelisted($ip) {
140
-		if($this->config->getSystemValue('auth.bruteforce.protection.enabled', true) === false) {
140
+		if ($this->config->getSystemValue('auth.bruteforce.protection.enabled', true) === false) {
141 141
 			return true;
142 142
 		}
143 143
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
 			$cx = explode('/', $cidr);
164 164
 			$addr = $cx[0];
165
-			$mask = (int)$cx[1];
165
+			$mask = (int) $cx[1];
166 166
 
167 167
 			// Do not compare ipv4 to ipv6
168 168
 			if (($type === 4 && !filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) ||
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 			$addr = inet_pton($addr);
174 174
 
175 175
 			$valid = true;
176
-			for($i = 0; $i < $mask; $i++) {
177
-				$part = ord($addr[(int)($i/8)]);
178
-				$orig = ord($ip[(int)($i/8)]);
176
+			for ($i = 0; $i < $mask; $i++) {
177
+				$part = ord($addr[(int) ($i / 8)]);
178
+				$orig = ord($ip[(int) ($i / 8)]);
179 179
 
180 180
 				$part = $part & (15 << (1 - ($i % 2)));
181 181
 				$orig = $orig & (15 << (1 - ($i % 2)));
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 */
205 205
 	public function getDelay($ip, $action = '') {
206 206
 		$ipAddress = new IpAddress($ip);
207
-		if ($this->isIPWhitelisted((string)$ipAddress)) {
207
+		if ($this->isIPWhitelisted((string) $ipAddress)) {
208 208
 			return 0;
209 209
 		}
210 210
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
 		$maxDelay = 30;
232 232
 		$firstDelay = 0.1;
233
-		if ($attempts > (8 * PHP_INT_SIZE - 1))  {
233
+		if ($attempts > (8 * PHP_INT_SIZE - 1)) {
234 234
 			// Don't ever overflow. Just assume the maxDelay time:s
235 235
 			$firstDelay = $maxDelay;
236 236
 		} else {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	public function resetDelay($ip, $action, $metadata) {
253 253
 		$ipAddress = new IpAddress($ip);
254
-		if ($this->isIPWhitelisted((string)$ipAddress)) {
254
+		if ($this->isIPWhitelisted((string) $ipAddress)) {
255 255
 			return;
256 256
 		}
257 257
 
Please login to merge, or discard this patch.
lib/base.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 	 * the app path list is empty or contains an invalid path
123 123
 	 */
124 124
 	public static function initPaths() {
125
-		if(defined('PHPUNIT_CONFIG_DIR')) {
126
-			self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
127
-		} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
128
-			self::$configDir = OC::$SERVERROOT . '/tests/config/';
129
-		} elseif($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
130
-			self::$configDir = rtrim($dir, '/') . '/';
125
+		if (defined('PHPUNIT_CONFIG_DIR')) {
126
+			self::$configDir = OC::$SERVERROOT.'/'.PHPUNIT_CONFIG_DIR.'/';
127
+		} elseif (defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT.'/tests/config/')) {
128
+			self::$configDir = OC::$SERVERROOT.'/tests/config/';
129
+		} elseif ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
130
+			self::$configDir = rtrim($dir, '/').'/';
131 131
 		} else {
132
-			self::$configDir = OC::$SERVERROOT . '/config/';
132
+			self::$configDir = OC::$SERVERROOT.'/config/';
133 133
 		}
134 134
 		self::$config = new \OC\Config(self::$configDir);
135 135
 
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 			//make sure suburi follows the same rules as scriptName
152 152
 			if (substr(OC::$SUBURI, -9) != 'index.php') {
153 153
 				if (substr(OC::$SUBURI, -1) != '/') {
154
-					OC::$SUBURI = OC::$SUBURI . '/';
154
+					OC::$SUBURI = OC::$SUBURI.'/';
155 155
 				}
156
-				OC::$SUBURI = OC::$SUBURI . 'index.php';
156
+				OC::$SUBURI = OC::$SUBURI.'index.php';
157 157
 			}
158 158
 		}
159 159
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 				OC::$WEBROOT = substr($scriptName, 0, 0 - strlen(OC::$SUBURI));
166 166
 
167 167
 				if (OC::$WEBROOT != '' && OC::$WEBROOT[0] !== '/') {
168
-					OC::$WEBROOT = '/' . OC::$WEBROOT;
168
+					OC::$WEBROOT = '/'.OC::$WEBROOT;
169 169
 				}
170 170
 			} else {
171 171
 				// The scriptName is not ending with OC::$SUBURI
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
 					OC::$APPSROOTS[] = $paths;
195 195
 				}
196 196
 			}
197
-		} elseif (file_exists(OC::$SERVERROOT . '/apps')) {
198
-			OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT . '/apps', 'url' => '/apps', 'writable' => true);
199
-		} elseif (file_exists(OC::$SERVERROOT . '/../apps')) {
197
+		} elseif (file_exists(OC::$SERVERROOT.'/apps')) {
198
+			OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT.'/apps', 'url' => '/apps', 'writable' => true);
199
+		} elseif (file_exists(OC::$SERVERROOT.'/../apps')) {
200 200
 			OC::$APPSROOTS[] = array(
201
-				'path' => rtrim(dirname(OC::$SERVERROOT), '/') . '/apps',
201
+				'path' => rtrim(dirname(OC::$SERVERROOT), '/').'/apps',
202 202
 				'url' => '/apps',
203 203
 				'writable' => true
204 204
 			);
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
 		$l = \OC::$server->getL10N('lib');
229 229
 
230 230
 		// Create config if it does not already exist
231
-		$configFilePath = self::$configDir .'/config.php';
232
-		if(!file_exists($configFilePath)) {
231
+		$configFilePath = self::$configDir.'/config.php';
232
+		if (!file_exists($configFilePath)) {
233 233
 			@touch($configFilePath);
234 234
 		}
235 235
 
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
 				echo $l->t('Cannot write into "config" directory!')."\n";
245 245
 				echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n";
246 246
 				echo "\n";
247
-				echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-dir_permissions') ])."\n";
247
+				echo $l->t('See %s', [$urlGenerator->linkToDocs('admin-dir_permissions')])."\n";
248 248
 				exit;
249 249
 			} else {
250 250
 				OC_Template::printErrorPage(
251 251
 					$l->t('Cannot write into "config" directory!'),
252 252
 					$l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
253
-					 [ $urlGenerator->linkToDocs('admin-dir_permissions') ])
253
+					 [$urlGenerator->linkToDocs('admin-dir_permissions')])
254 254
 				);
255 255
 			}
256 256
 		}
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
 			if (OC::$CLI) {
266 266
 				throw new Exception('Not installed');
267 267
 			} else {
268
-				$url = OC::$WEBROOT . '/index.php';
269
-				header('Location: ' . $url);
268
+				$url = OC::$WEBROOT.'/index.php';
269
+				header('Location: '.$url);
270 270
 			}
271 271
 			exit();
272 272
 		}
@@ -394,14 +394,14 @@  discard block
 block discarded – undo
394 394
 		$incompatibleShippedApps = [];
395 395
 		foreach ($incompatibleApps as $appInfo) {
396 396
 			if ($appManager->isShipped($appInfo['id'])) {
397
-				$incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
397
+				$incompatibleShippedApps[] = $appInfo['name'].' ('.$appInfo['id'].')';
398 398
 			}
399 399
 		}
400 400
 
401 401
 		if (!empty($incompatibleShippedApps)) {
402 402
 			$l = \OC::$server->getL10N('core');
403 403
 			$hint = $l->t('The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server.', [implode(', ', $incompatibleShippedApps)]);
404
-			throw new \OC\HintException('The files of the app ' . implode(', ', $incompatibleShippedApps) . ' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
404
+			throw new \OC\HintException('The files of the app '.implode(', ', $incompatibleShippedApps).' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
405 405
 		}
406 406
 
407 407
 		$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		ini_set('session.cookie_httponly', true);
417 417
 
418 418
 		// set the cookie path to the Nextcloud directory
419
-		$cookie_path = OC::$WEBROOT ? : '/';
419
+		$cookie_path = OC::$WEBROOT ?: '/';
420 420
 		ini_set('session.cookie_path', $cookie_path);
421 421
 
422 422
 		// Let the session name be changed in the initSession Hook
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 		// session timeout
451 451
 		if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) {
452 452
 			if (isset($_COOKIE[session_name()])) {
453
-				setcookie(session_name(), null, -1, self::$WEBROOT ? : '/');
453
+				setcookie(session_name(), null, -1, self::$WEBROOT ?: '/');
454 454
 			}
455 455
 			\OC::$server->getUserSession()->logout();
456 456
 		}
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 				continue;
473 473
 			}
474 474
 
475
-			$file = $appPath . '/appinfo/classpath.php';
475
+			$file = $appPath.'/appinfo/classpath.php';
476 476
 			if (file_exists($file)) {
477 477
 				require_once $file;
478 478
 			}
@@ -500,14 +500,14 @@  discard block
 block discarded – undo
500 500
 
501 501
 		// Append __Host to the cookie if it meets the requirements
502 502
 		$cookiePrefix = '';
503
-		if($cookieParams['secure'] === true && $cookieParams['path'] === '/') {
503
+		if ($cookieParams['secure'] === true && $cookieParams['path'] === '/') {
504 504
 			$cookiePrefix = '__Host-';
505 505
 		}
506 506
 
507
-		foreach($policies as $policy) {
507
+		foreach ($policies as $policy) {
508 508
 			header(
509 509
 				sprintf(
510
-					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;' . $secureCookie . 'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
510
+					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;'.$secureCookie.'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
511 511
 					$cookiePrefix,
512 512
 					$policy,
513 513
 					$cookieParams['path'],
@@ -538,31 +538,31 @@  discard block
 block discarded – undo
538 538
 			// OS X Finder
539 539
 			'/^WebDAVFS/',
540 540
 		];
541
-		if($request->isUserAgent($incompatibleUserAgents)) {
541
+		if ($request->isUserAgent($incompatibleUserAgents)) {
542 542
 			return;
543 543
 		}
544 544
 
545
-		if(count($_COOKIE) > 0) {
545
+		if (count($_COOKIE) > 0) {
546 546
 			$requestUri = $request->getScriptName();
547 547
 			$processingScript = explode('/', $requestUri);
548
-			$processingScript = $processingScript[count($processingScript)-1];
548
+			$processingScript = $processingScript[count($processingScript) - 1];
549 549
 
550 550
 			// index.php routes are handled in the middleware
551
-			if($processingScript === 'index.php') {
551
+			if ($processingScript === 'index.php') {
552 552
 				return;
553 553
 			}
554 554
 
555 555
 			// All other endpoints require the lax and the strict cookie
556
-			if(!$request->passesStrictCookieCheck()) {
556
+			if (!$request->passesStrictCookieCheck()) {
557 557
 				self::sendSameSiteCookies();
558 558
 				// Debug mode gets access to the resources without strict cookie
559 559
 				// due to the fact that the SabreDAV browser also lives there.
560
-				if(!\OC::$server->getConfig()->getSystemValue('debug', false)) {
560
+				if (!\OC::$server->getConfig()->getSystemValue('debug', false)) {
561 561
 					http_response_code(\OCP\AppFramework\Http::STATUS_SERVICE_UNAVAILABLE);
562 562
 					exit();
563 563
 				}
564 564
 			}
565
-		} elseif(!isset($_COOKIE['nc_sameSiteCookielax']) || !isset($_COOKIE['nc_sameSiteCookiestrict'])) {
565
+		} elseif (!isset($_COOKIE['nc_sameSiteCookielax']) || !isset($_COOKIE['nc_sameSiteCookiestrict'])) {
566 566
 			self::sendSameSiteCookies();
567 567
 		}
568 568
 	}
@@ -573,12 +573,12 @@  discard block
 block discarded – undo
573 573
 
574 574
 		// register autoloader
575 575
 		$loaderStart = microtime(true);
576
-		require_once __DIR__ . '/autoloader.php';
576
+		require_once __DIR__.'/autoloader.php';
577 577
 		self::$loader = new \OC\Autoloader([
578
-			OC::$SERVERROOT . '/lib/private/legacy',
578
+			OC::$SERVERROOT.'/lib/private/legacy',
579 579
 		]);
580 580
 		if (defined('PHPUNIT_RUN')) {
581
-			self::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
581
+			self::$loader->addValidRoot(OC::$SERVERROOT.'/tests');
582 582
 		}
583 583
 		spl_autoload_register(array(self::$loader, 'load'));
584 584
 		$loaderEnd = microtime(true);
@@ -586,12 +586,12 @@  discard block
 block discarded – undo
586 586
 		self::$CLI = (php_sapi_name() == 'cli');
587 587
 
588 588
 		// Add default composer PSR-4 autoloader
589
-		self::$composerAutoloader = require_once OC::$SERVERROOT . '/lib/composer/autoload.php';
589
+		self::$composerAutoloader = require_once OC::$SERVERROOT.'/lib/composer/autoload.php';
590 590
 
591 591
 		try {
592 592
 			self::initPaths();
593 593
 			// setup 3rdparty autoloader
594
-			$vendorAutoLoad = OC::$SERVERROOT. '/3rdparty/autoload.php';
594
+			$vendorAutoLoad = OC::$SERVERROOT.'/3rdparty/autoload.php';
595 595
 			if (!file_exists($vendorAutoLoad)) {
596 596
 				throw new \RuntimeException('Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".');
597 597
 			}
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 			if (!self::$CLI) {
602 602
 				$claimedProtocol = strtoupper($_SERVER['SERVER_PROTOCOL']);
603 603
 				$protocol = in_array($claimedProtocol, ['HTTP/1.0', 'HTTP/1.1', 'HTTP/2']) ? $claimedProtocol : 'HTTP/1.1';
604
-				header($protocol . ' ' . OC_Response::STATUS_SERVICE_UNAVAILABLE);
604
+				header($protocol.' '.OC_Response::STATUS_SERVICE_UNAVAILABLE);
605 605
 			}
606 606
 			// we can't use the template error page here, because this needs the
607 607
 			// DI container which isn't available yet
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 		@ini_set('display_errors', 0);
620 620
 		@ini_set('log_errors', 1);
621 621
 
622
-		if(!date_default_timezone_set('UTC')) {
622
+		if (!date_default_timezone_set('UTC')) {
623 623
 			throw new \RuntimeException('Could not set timezone to UTC');
624 624
 		};
625 625
 
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 		self::checkInstalled();
664 664
 
665 665
 		OC_Response::addSecurityHeaders();
666
-		if(self::$server->getRequest()->getServerProtocol() === 'https') {
666
+		if (self::$server->getRequest()->getServerProtocol() === 'https') {
667 667
 			ini_set('session.cookie_secure', true);
668 668
 		}
669 669
 
@@ -676,11 +676,11 @@  discard block
 block discarded – undo
676 676
 					// Convert l10n string into regular string for usage in database
677 677
 					$staticErrors = [];
678 678
 					foreach ($errors as $error) {
679
-						echo $error['error'] . "\n";
680
-						echo $error['hint'] . "\n\n";
679
+						echo $error['error']."\n";
680
+						echo $error['hint']."\n\n";
681 681
 						$staticErrors[] = [
682
-							'error' => (string)$error['error'],
683
-							'hint' => (string)$error['hint'],
682
+							'error' => (string) $error['error'],
683
+							'hint' => (string) $error['hint'],
684 684
 						];
685 685
 					}
686 686
 
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 		}
703 703
 		//try to set the session lifetime
704 704
 		$sessionLifeTime = self::getSessionLifeTime();
705
-		@ini_set('gc_maxlifetime', (string)$sessionLifeTime);
705
+		@ini_set('gc_maxlifetime', (string) $sessionLifeTime);
706 706
 
707 707
 		$systemConfig = \OC::$server->getSystemConfig();
708 708
 
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 		register_shutdown_function(array($lockProvider, 'releaseAll'));
749 749
 
750 750
 		// Check whether the sample configuration has been copied
751
-		if($systemConfig->getValue('copied_sample_config', false)) {
751
+		if ($systemConfig->getValue('copied_sample_config', false)) {
752 752
 			$l = \OC::$server->getL10N('lib');
753 753
 			header('HTTP/1.1 503 Service Temporarily Unavailable');
754 754
 			header('Status: 503 Service Temporarily Unavailable');
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 		) {
775 775
 			// Allow access to CSS resources
776 776
 			$isScssRequest = false;
777
-			if(strpos($request->getPathInfo(), '/css/') === 0) {
777
+			if (strpos($request->getPathInfo(), '/css/') === 0) {
778 778
 				$isScssRequest = true;
779 779
 			}
780 780
 
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 
811 811
 			// NOTE: This will be replaced to use OCP
812 812
 			$userSession = self::$server->getUserSession();
813
-			$userSession->listen('\OC\User', 'postLogin', function () use ($userSession) {
813
+			$userSession->listen('\OC\User', 'postLogin', function() use ($userSession) {
814 814
 				if (!defined('PHPUNIT_RUN')) {
815 815
 					// reset brute force delay for this IP address and username
816 816
 					$uid = \OC::$server->getUserSession()->getUser()->getUID();
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 				} catch (\Exception $e) {
831 831
 					// a GC exception should not prevent users from using OC,
832 832
 					// so log the exception
833
-					\OC::$server->getLogger()->warning('Exception when running cache gc: ' . $e->getMessage(), array('app' => 'core'));
833
+					\OC::$server->getLogger()->warning('Exception when running cache gc: '.$e->getMessage(), array('app' => 'core'));
834 834
 				}
835 835
 			});
836 836
 		}
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 			/** @var \OCP\App\ManagerEvent $event */
847 847
 			$jobList = \OC::$server->getJobList();
848 848
 			$job = 'OC\\Settings\\RemoveOrphaned';
849
-			if(!($jobList->has($job, null))) {
849
+			if (!($jobList->has($job, null))) {
850 850
 				$jobList->add($job);
851 851
 			}
852 852
 		});
@@ -944,12 +944,12 @@  discard block
 block discarded – undo
944 944
 		// emergency app disabling
945 945
 		if ($requestPath === '/disableapp'
946 946
 			&& $request->getMethod() === 'POST'
947
-			&& ((array)$request->getParam('appid')) !== ''
947
+			&& ((array) $request->getParam('appid')) !== ''
948 948
 		) {
949 949
 			\OCP\JSON::callCheck();
950 950
 			\OCP\JSON::checkAdminUser();
951
-			$appIds = (array)$request->getParam('appid');
952
-			foreach($appIds as $appId) {
951
+			$appIds = (array) $request->getParam('appid');
952
+			foreach ($appIds as $appId) {
953 953
 				$appId = \OC_App::cleanAppId($appId);
954 954
 				\OC_App::disable($appId);
955 955
 			}
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 		if (!self::checkUpgrade(false)
965 965
 			&& !$systemConfig->getValue('maintenance', false)) {
966 966
 			// For logged-in users: Load everything
967
-			if(\OC::$server->getUserSession()->isLoggedIn()) {
967
+			if (\OC::$server->getUserSession()->isLoggedIn()) {
968 968
 				OC_App::loadApps();
969 969
 			} else {
970 970
 				// For guests: Load only filesystem and logging
Please login to merge, or discard this patch.