Completed
Pull Request — master (#8630)
by Blizzz
25:22 queued 01:35
created
lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -362,77 +362,77 @@
 block discarded – undo
362 362
 		$policy .= "base-uri 'none';";
363 363
 		$policy .= "manifest-src 'self';";
364 364
 
365
-		if(!empty($this->allowedScriptDomains) || $this->inlineScriptAllowed || $this->evalScriptAllowed) {
365
+		if (!empty($this->allowedScriptDomains) || $this->inlineScriptAllowed || $this->evalScriptAllowed) {
366 366
 			$policy .= 'script-src ';
367
-			if(is_string($this->useJsNonce)) {
367
+			if (is_string($this->useJsNonce)) {
368 368
 				$policy .= '\'nonce-'.base64_encode($this->useJsNonce).'\'';
369 369
 				$allowedScriptDomains = array_flip($this->allowedScriptDomains);
370 370
 				unset($allowedScriptDomains['\'self\'']);
371 371
 				$this->allowedScriptDomains = array_flip($allowedScriptDomains);
372
-				if(count($allowedScriptDomains) !== 0) {
372
+				if (count($allowedScriptDomains) !== 0) {
373 373
 					$policy .= ' ';
374 374
 				}
375 375
 			}
376
-			if(is_array($this->allowedScriptDomains)) {
376
+			if (is_array($this->allowedScriptDomains)) {
377 377
 				$policy .= implode(' ', $this->allowedScriptDomains);
378 378
 			}
379
-			if($this->inlineScriptAllowed) {
379
+			if ($this->inlineScriptAllowed) {
380 380
 				$policy .= ' \'unsafe-inline\'';
381 381
 			}
382
-			if($this->evalScriptAllowed) {
382
+			if ($this->evalScriptAllowed) {
383 383
 				$policy .= ' \'unsafe-eval\'';
384 384
 			}
385 385
 			$policy .= ';';
386 386
 		}
387 387
 
388
-		if(!empty($this->allowedStyleDomains) || $this->inlineStyleAllowed) {
388
+		if (!empty($this->allowedStyleDomains) || $this->inlineStyleAllowed) {
389 389
 			$policy .= 'style-src ';
390
-			if(is_array($this->allowedStyleDomains)) {
390
+			if (is_array($this->allowedStyleDomains)) {
391 391
 				$policy .= implode(' ', $this->allowedStyleDomains);
392 392
 			}
393
-			if($this->inlineStyleAllowed) {
393
+			if ($this->inlineStyleAllowed) {
394 394
 				$policy .= ' \'unsafe-inline\'';
395 395
 			}
396 396
 			$policy .= ';';
397 397
 		}
398 398
 
399
-		if(!empty($this->allowedImageDomains)) {
400
-			$policy .= 'img-src ' . implode(' ', $this->allowedImageDomains);
399
+		if (!empty($this->allowedImageDomains)) {
400
+			$policy .= 'img-src '.implode(' ', $this->allowedImageDomains);
401 401
 			$policy .= ';';
402 402
 		}
403 403
 
404
-		if(!empty($this->allowedFontDomains)) {
405
-			$policy .= 'font-src ' . implode(' ', $this->allowedFontDomains);
404
+		if (!empty($this->allowedFontDomains)) {
405
+			$policy .= 'font-src '.implode(' ', $this->allowedFontDomains);
406 406
 			$policy .= ';';
407 407
 		}
408 408
 
409
-		if(!empty($this->allowedConnectDomains)) {
410
-			$policy .= 'connect-src ' . implode(' ', $this->allowedConnectDomains);
409
+		if (!empty($this->allowedConnectDomains)) {
410
+			$policy .= 'connect-src '.implode(' ', $this->allowedConnectDomains);
411 411
 			$policy .= ';';
412 412
 		}
413 413
 
414
-		if(!empty($this->allowedMediaDomains)) {
415
-			$policy .= 'media-src ' . implode(' ', $this->allowedMediaDomains);
414
+		if (!empty($this->allowedMediaDomains)) {
415
+			$policy .= 'media-src '.implode(' ', $this->allowedMediaDomains);
416 416
 			$policy .= ';';
417 417
 		}
418 418
 
419
-		if(!empty($this->allowedObjectDomains)) {
420
-			$policy .= 'object-src ' . implode(' ', $this->allowedObjectDomains);
419
+		if (!empty($this->allowedObjectDomains)) {
420
+			$policy .= 'object-src '.implode(' ', $this->allowedObjectDomains);
421 421
 			$policy .= ';';
422 422
 		}
423 423
 
424
-		if(!empty($this->allowedFrameDomains)) {
425
-			$policy .= 'frame-src ' . implode(' ', $this->allowedFrameDomains);
424
+		if (!empty($this->allowedFrameDomains)) {
425
+			$policy .= 'frame-src '.implode(' ', $this->allowedFrameDomains);
426 426
 			$policy .= ';';
427 427
 		}
428 428
 
429
-		if(!empty($this->allowedChildSrcDomains)) {
430
-			$policy .= 'child-src ' . implode(' ', $this->allowedChildSrcDomains);
429
+		if (!empty($this->allowedChildSrcDomains)) {
430
+			$policy .= 'child-src '.implode(' ', $this->allowedChildSrcDomains);
431 431
 			$policy .= ';';
432 432
 		}
433 433
 
434
-		if(!empty($this->allowedFrameAncestors)) {
435
-			$policy .= 'frame-ancestors ' . implode(' ', $this->allowedFrameAncestors);
434
+		if (!empty($this->allowedFrameAncestors)) {
435
+			$policy .= 'frame-ancestors '.implode(' ', $this->allowedFrameAncestors);
436 436
 			$policy .= ';';
437 437
 		}
438 438
 
Please login to merge, or discard this patch.
core/templates/error.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <div class="error">
2 2
 	<h2><?php p($l->t('Error')) ?></h2>
3 3
 	<ul>
4
-	<?php foreach($_["errors"] as $error):?>
4
+	<?php foreach ($_["errors"] as $error):?>
5 5
 		<li>
6 6
 			<p><?php p($error['error']) ?></p>
7
-			<?php if(isset($error['hint']) && $error['hint']): ?>
7
+			<?php if (isset($error['hint']) && $error['hint']): ?>
8 8
 				<p class='hint'><?php p($error['hint']) ?></p>
9
-			<?php endif;?>
9
+			<?php endif; ?>
10 10
 		</li>
11 11
 	<?php endforeach ?>
12 12
 	</ul>
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Settings/Personal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 	 */
65 65
 	public function getForm() {
66 66
 		$cloudID = $this->userSession->getUser()->getCloudId();
67
-		$url = 'https://nextcloud.com/federation#' . $cloudID;
67
+		$url = 'https://nextcloud.com/federation#'.$cloudID;
68 68
 
69 69
 		$parameters = [
70 70
 			'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(),
Please login to merge, or discard this patch.
settings/Controller/CommonSettingsTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 use OCP\Settings\IIconSection;
29 29
 use OCP\Settings\ISettings;
30 30
 
31
-trait CommonSettingsTrait  {
31
+trait CommonSettingsTrait {
32 32
 	/** @var ISettingsManager */
33 33
 	private $settingsManager;
34 34
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			'admin' => []
43 43
 		];
44 44
 
45
-		if(\OC_User::isAdminUser(\OC_User::getUser())) {
45
+		if (\OC_User::isAdminUser(\OC_User::getUser())) {
46 46
 			$templateParameters['admin'] = $this->formatAdminSections($currentType, $currentSection);
47 47
 		}
48 48
 
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 	protected function formatSections($sections, $currentSection, $type, $currentType) {
55 55
 		$templateParameters = [];
56 56
 		/** @var \OCP\Settings\ISection[] $prioritizedSections */
57
-		foreach($sections as $prioritizedSections) {
57
+		foreach ($sections as $prioritizedSections) {
58 58
 			foreach ($prioritizedSections as $section) {
59
-				if($type === 'admin') {
59
+				if ($type === 'admin') {
60 60
 					$settings = $this->settingsManager->getAdminSettings($section->getID());
61
-				} else if($type === 'personal') {
61
+				} else if ($type === 'personal') {
62 62
 					$settings = $this->settingsManager->getPersonalSettings($section->getID());
63 63
 				}
64 64
 				if (empty($settings)) {
Please login to merge, or discard this patch.
lib/private/Settings/Admin/Server.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 		$suggestedOverwriteCliUrl = '';
109 109
 		if ($this->config->getSystemValue('overwrite.cli.url', '') === '') {
110
-			$suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT;
110
+			$suggestedOverwriteCliUrl = $this->request->getServerProtocol().'://'.$this->request->getInsecureServerHost().\OC::$WEBROOT;
111 111
 			if (!$this->config->getSystemValue('config_is_read_only', false)) {
112 112
 				// Set the overwrite URL when it was not set yet.
113 113
 				$this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 			'lastcron'            => $this->config->getAppValue('core', 'lastcron', false),
135 135
 			'cronErrors'		  => $this->config->getAppValue('core', 'cronErrors'),
136 136
 			'cli_based_cron_possible' => function_exists('posix_getpwuid'),
137
-			'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '',
137
+			'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir.'config.php'))['name'] : '',
138 138
 		];
139 139
 
140 140
 		return new TemplateResponse('settings', 'settings/admin/server', $parameters, '');
Please login to merge, or discard this patch.
core/Controller/OCSController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			'edition' => '',
96 96
 		);
97 97
 
98
-		if($this->userSession->isLoggedIn()) {
98
+		if ($this->userSession->isLoggedIn()) {
99 99
 			$result['capabilities'] = $this->capabilitiesManager->getCapabilities();
100 100
 		} else {
101 101
 			$result['capabilities'] = $this->capabilitiesManager->getCapabilities(true);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	public function getIdentityProof($cloudId) {
139 139
 		$userObject = $this->userManager->get($cloudId);
140 140
 
141
-		if($userObject !== null) {
141
+		if ($userObject !== null) {
142 142
 			$key = $this->keyManager->getKey($userObject);
143 143
 			$data = [
144 144
 				'public' => $key->getPublic(),
Please login to merge, or discard this patch.
apps/admin_audit/lib/AppInfo/Application.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -77,24 +77,24 @@  discard block
 block discarded – undo
77 77
 	protected function userManagementHooks(ILogger $logger) {
78 78
 		$userActions = new UserManagement($logger);
79 79
 
80
-		Util::connectHook('OC_User', 'post_createUser',	$userActions, 'create');
81
-		Util::connectHook('OC_User', 'post_deleteUser',	$userActions, 'delete');
82
-		Util::connectHook('OC_User', 'changeUser',	$userActions, 'change');
80
+		Util::connectHook('OC_User', 'post_createUser', $userActions, 'create');
81
+		Util::connectHook('OC_User', 'post_deleteUser', $userActions, 'delete');
82
+		Util::connectHook('OC_User', 'changeUser', $userActions, 'change');
83 83
 
84 84
 		/** @var IUserSession|Session $userSession */
85 85
 		$userSession = $this->getContainer()->getServer()->getUserSession();
86 86
 		$userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']);
87 87
 	}
88 88
 
89
-	protected function groupHooks(ILogger $logger)  {
89
+	protected function groupHooks(ILogger $logger) {
90 90
 		$groupActions = new GroupManagement($logger);
91 91
 
92 92
 		/** @var IGroupManager|Manager $groupManager */
93 93
 		$groupManager = $this->getContainer()->getServer()->getGroupManager();
94
-		$groupManager->listen('\OC\Group', 'postRemoveUser',  [$groupActions, 'removeUser']);
95
-		$groupManager->listen('\OC\Group', 'postAddUser',  [$groupActions, 'addUser']);
96
-		$groupManager->listen('\OC\Group', 'postDelete',  [$groupActions, 'deleteGroup']);
97
-		$groupManager->listen('\OC\Group', 'postCreate',  [$groupActions, 'createGroup']);
94
+		$groupManager->listen('\OC\Group', 'postRemoveUser', [$groupActions, 'removeUser']);
95
+		$groupManager->listen('\OC\Group', 'postAddUser', [$groupActions, 'addUser']);
96
+		$groupManager->listen('\OC\Group', 'postDelete', [$groupActions, 'deleteGroup']);
97
+		$groupManager->listen('\OC\Group', 'postCreate', [$groupActions, 'createGroup']);
98 98
 	}
99 99
 
100 100
 	protected function sharingHooks(ILogger $logger) {
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	protected function versionsHooks(ILogger $logger) {
208 208
 		$versionsActions = new Versions($logger);
209 209
 		Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback');
210
-		Util::connectHook('\OCP\Versions', 'delete',$versionsActions, 'delete');
210
+		Util::connectHook('\OCP\Versions', 'delete', $versionsActions, 'delete');
211 211
 	}
212 212
 
213 213
 	protected function trashbinHooks(ILogger $logger) {
Please login to merge, or discard this patch.
apps/admin_audit/lib/Actions/Sharing.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @param array $params
36 36
 	 */
37 37
 	public function shared(array $params) {
38
-		if($params['shareType'] === Share::SHARE_TYPE_LINK) {
38
+		if ($params['shareType'] === Share::SHARE_TYPE_LINK) {
39 39
 			$this->log(
40 40
 				'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)',
41 41
 				$params,
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 					'id',
48 48
 				]
49 49
 			);
50
-		} elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
50
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_USER) {
51 51
 			$this->log(
52 52
 				'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s"  (Share ID: %s)',
53 53
 				$params,
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 					'id',
61 61
 				]
62 62
 			);
63
-		} elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
63
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) {
64 64
 			$this->log(
65 65
 				'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s"  (Share ID: %s)',
66 66
 				$params,
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param array $params
83 83
 	 */
84 84
 	public function unshare(array $params) {
85
-		if($params['shareType'] === Share::SHARE_TYPE_LINK) {
85
+		if ($params['shareType'] === Share::SHARE_TYPE_LINK) {
86 86
 			$this->log(
87 87
 				'The %s "%s" with ID "%s" has been unshared (Share ID: %s)',
88 88
 				$params,
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 					'id',
94 94
 				]
95 95
 			);
96
-		} elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
96
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_USER) {
97 97
 			$this->log(
98 98
 				'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)',
99 99
 				$params,
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 					'id',
106 106
 				]
107 107
 			);
108
-		} elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
108
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) {
109 109
 			$this->log(
110 110
 				'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)',
111 111
 				$params,
Please login to merge, or discard this patch.
apps/admin_audit/lib/Actions/Action.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 						array $params,
48 48
 						array $elements,
49 49
 						$obfuscateParameters = false) {
50
-		foreach($elements as $element) {
51
-			if(!isset($params[$element])) {
50
+		foreach ($elements as $element) {
51
+			if (!isset($params[$element])) {
52 52
 				if ($obfuscateParameters) {
53 53
 					$this->logger->critical(
54 54
 						'$params["'.$element.'"] was missing.',
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		}
69 69
 
70 70
 		$replaceArray = [];
71
-		foreach($elements as $element) {
72
-			if($params[$element] instanceof \DateTime) {
71
+		foreach ($elements as $element) {
72
+			if ($params[$element] instanceof \DateTime) {
73 73
 				$params[$element] = $params[$element]->format('Y-m-d H:i:s');
74 74
 			}
75 75
 			$replaceArray[] = $params[$element];
Please login to merge, or discard this patch.