@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | private function quoteKeys(array $data) { |
33 | 33 | $return = []; |
34 | 34 | $c = $this->getDatabasePlatform()->getIdentifierQuoteCharacter(); |
35 | - foreach($data as $key => $value) { |
|
35 | + foreach ($data as $key => $value) { |
|
36 | 36 | if ($key[0] !== $c) { |
37 | 37 | $return[$this->quoteIdentifier($key)] = $value; |
38 | 38 | } else { |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | * @param string $table table name without the prefix |
83 | 83 | */ |
84 | 84 | public function dropTable($table) { |
85 | - $table = $this->tablePrefix . trim($table); |
|
85 | + $table = $this->tablePrefix.trim($table); |
|
86 | 86 | $table = $this->quoteIdentifier($table); |
87 | 87 | $schema = $this->getSchemaManager(); |
88 | - if($schema->tablesExist(array($table))) { |
|
88 | + if ($schema->tablesExist(array($table))) { |
|
89 | 89 | $schema->dropTable($table); |
90 | 90 | } |
91 | 91 | } |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | * @param string $table table name without the prefix |
97 | 97 | * @return bool |
98 | 98 | */ |
99 | - public function tableExists($table){ |
|
100 | - $table = $this->tablePrefix . trim($table); |
|
99 | + public function tableExists($table) { |
|
100 | + $table = $this->tablePrefix.trim($table); |
|
101 | 101 | $table = $this->quoteIdentifier($table); |
102 | 102 | $schema = $this->getSchemaManager(); |
103 | 103 | return $schema->tablesExist(array($table)); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @throws \Doctrine\DBAL\Schema\SchemaException |
81 | 81 | */ |
82 | 82 | public function getTable($tableName) { |
83 | - return $this->schema->getTable($this->connection->getPrefix() . $tableName); |
|
83 | + return $this->schema->getTable($this->connection->getPrefix().$tableName); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return boolean |
92 | 92 | */ |
93 | 93 | public function hasTable($tableName) { |
94 | - return $this->schema->hasTable($this->connection->getPrefix() . $tableName); |
|
94 | + return $this->schema->hasTable($this->connection->getPrefix().$tableName); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return \Doctrine\DBAL\Schema\Table |
102 | 102 | */ |
103 | 103 | public function createTable($tableName) { |
104 | - return $this->schema->createTable($this->connection->getPrefix() . $tableName); |
|
104 | + return $this->schema->createTable($this->connection->getPrefix().$tableName); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function dropTable($tableName) { |
127 | 127 | $this->tablesToDelete[$tableName] = true; |
128 | - return $this->schema->dropTable($this->connection->getPrefix() . $tableName); |
|
128 | + return $this->schema->dropTable($this->connection->getPrefix().$tableName); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | public function getACL() { |
113 | - $acl = [ |
|
113 | + $acl = [ |
|
114 | 114 | [ |
115 | 115 | 'privilege' => '{DAV:}read', |
116 | 116 | 'principal' => $this->getOwner(), |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | if ($this->getOwner() !== parent::getOwner()) { |
134 | - $acl[] = [ |
|
134 | + $acl[] = [ |
|
135 | 135 | 'privilege' => '{DAV:}read', |
136 | 136 | 'principal' => parent::getOwner(), |
137 | 137 | 'protected' => true, |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function delete() { |
179 | 179 | if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) && |
180 | 180 | $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) { |
181 | - $principal = 'principal:' . parent::getOwner(); |
|
181 | + $principal = 'principal:'.parent::getOwner(); |
|
182 | 182 | $shares = $this->caldavBackend->getShares($this->getResourceId()); |
183 | 183 | $shares = array_filter($shares, function($share) use ($principal){ |
184 | 184 | return $share['href'] === $principal; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | $uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters); |
269 | 269 | if ($this->isShared()) { |
270 | - return array_filter($uris, function ($uri) { |
|
270 | + return array_filter($uris, function($uri) { |
|
271 | 271 | return $this->childExists($uri); |
272 | 272 | }); |
273 | 273 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->config = $config; |
97 | 97 | |
98 | 98 | $this->excludedPaths[] = 'files_encryption'; |
99 | - $this->excludedPaths[] = 'appdata_' . $config->getSystemValue('instanceid', null); |
|
99 | + $this->excludedPaths[] = 'appdata_'.$config->getSystemValue('instanceid', null); |
|
100 | 100 | $this->excludedPaths[] = 'files_external'; |
101 | 101 | } |
102 | 102 | |
@@ -136,12 +136,12 @@ discard block |
||
136 | 136 | * @throws EncryptionHeaderKeyExistsException if header key is already in use |
137 | 137 | */ |
138 | 138 | public function createHeader(array $headerData, IEncryptionModule $encryptionModule) { |
139 | - $header = self::HEADER_START . ':' . self::HEADER_ENCRYPTION_MODULE_KEY . ':' . $encryptionModule->getId() . ':'; |
|
139 | + $header = self::HEADER_START.':'.self::HEADER_ENCRYPTION_MODULE_KEY.':'.$encryptionModule->getId().':'; |
|
140 | 140 | foreach ($headerData as $key => $value) { |
141 | 141 | if (in_array($key, $this->ocHeaderKeys)) { |
142 | 142 | throw new EncryptionHeaderKeyExistsException($key); |
143 | 143 | } |
144 | - $header .= $key . ':' . $value . ':'; |
|
144 | + $header .= $key.':'.$value.':'; |
|
145 | 145 | } |
146 | 146 | $header .= self::HEADER_END; |
147 | 147 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($c->getType() === 'dir') { |
173 | 173 | $dirList[] = $c->getPath(); |
174 | 174 | } else { |
175 | - $result[] = $c->getPath(); |
|
175 | + $result[] = $c->getPath(); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
@@ -249,15 +249,15 @@ discard block |
||
249 | 249 | public function stripPartialFileExtension($path) { |
250 | 250 | $extension = pathinfo($path, PATHINFO_EXTENSION); |
251 | 251 | |
252 | - if ( $extension === 'part') { |
|
252 | + if ($extension === 'part') { |
|
253 | 253 | |
254 | 254 | $newLength = strlen($path) - 5; // 5 = strlen(".part") |
255 | 255 | $fPath = substr($path, 0, $newLength); |
256 | 256 | |
257 | 257 | // if path also contains a transaction id, we remove it too |
258 | 258 | $extension = pathinfo($fPath, PATHINFO_EXTENSION); |
259 | - if(substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") |
|
260 | - $newLength = strlen($fPath) - strlen($extension) -1; |
|
259 | + if (substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") |
|
260 | + $newLength = strlen($fPath) - strlen($extension) - 1; |
|
261 | 261 | $fPath = substr($fPath, 0, $newLength); |
262 | 262 | } |
263 | 263 | return $fPath; |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | if (\OCP\App::isEnabled("files_external")) { |
302 | 302 | $mounts = \OC_Mount_Config::getSystemMountPoints(); |
303 | 303 | foreach ($mounts as $mount) { |
304 | - if (strpos($path, '/files/' . $mount['mountpoint']) === 0) { |
|
304 | + if (strpos($path, '/files/'.$mount['mountpoint']) === 0) { |
|
305 | 305 | if ($this->isMountPointApplicableToUser($mount, $uid)) { |
306 | 306 | return true; |
307 | 307 | } |
@@ -114,18 +114,18 @@ discard block |
||
114 | 114 | * @param int $remoteId |
115 | 115 | * @return Mount|null |
116 | 116 | */ |
117 | - public function addShare($remote, $token, $password, $name, $owner, $accepted=false, $user = null, $remoteId = -1) { |
|
117 | + public function addShare($remote, $token, $password, $name, $owner, $accepted = false, $user = null, $remoteId = -1) { |
|
118 | 118 | |
119 | 119 | $user = $user ? $user : $this->uid; |
120 | 120 | $accepted = $accepted ? 1 : 0; |
121 | - $name = Filesystem::normalizePath('/' . $name); |
|
121 | + $name = Filesystem::normalizePath('/'.$name); |
|
122 | 122 | |
123 | 123 | if (!$accepted) { |
124 | 124 | // To avoid conflicts with the mount point generation later, |
125 | 125 | // we only use a temporary mount point name here. The real |
126 | 126 | // mount point name will be generated when accepting the share, |
127 | 127 | // using the original share item name. |
128 | - $tmpMountPointName = '{{TemporaryMountPointName#' . $name . '}}'; |
|
128 | + $tmpMountPointName = '{{TemporaryMountPointName#'.$name.'}}'; |
|
129 | 129 | $mountPoint = $tmpMountPointName; |
130 | 130 | $hash = md5($tmpMountPointName); |
131 | 131 | $data = [ |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $i = 1; |
145 | 145 | while (!$this->connection->insertIfNotExist('*PREFIX*share_external', $data, ['user', 'mountpoint_hash'])) { |
146 | 146 | // The external share already exists for the user |
147 | - $data['mountpoint'] = $tmpMountPointName . '-' . $i; |
|
147 | + $data['mountpoint'] = $tmpMountPointName.'-'.$i; |
|
148 | 148 | $data['mountpoint_hash'] = md5($data['mountpoint']); |
149 | 149 | $i++; |
150 | 150 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | $mountPoint = Files::buildNotExistingFileName('/', $name); |
155 | - $mountPoint = Filesystem::normalizePath('/' . $mountPoint); |
|
155 | + $mountPoint = Filesystem::normalizePath('/'.$mountPoint); |
|
156 | 156 | $hash = md5($mountPoint); |
157 | 157 | |
158 | 158 | $query = $this->connection->prepare(' |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $federationEndpoints = $this->discoveryService->discover($remote, 'FEDERATED_SHARING'); |
272 | 272 | $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; |
273 | 273 | |
274 | - $url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT; |
|
274 | + $url = rtrim($remote, '/').$endpoint.'/'.$remoteId.'/'.$feedback.'?format='.\OCP\Share::RESPONSE_FORMAT; |
|
275 | 275 | $fields = array('token' => $token); |
276 | 276 | |
277 | 277 | $client = $this->clientService->newClient(); |
@@ -300,13 +300,13 @@ discard block |
||
300 | 300 | * @return string |
301 | 301 | */ |
302 | 302 | protected function stripPath($path) { |
303 | - $prefix = '/' . $this->uid . '/files'; |
|
303 | + $prefix = '/'.$this->uid.'/files'; |
|
304 | 304 | return rtrim(substr($path, strlen($prefix)), '/'); |
305 | 305 | } |
306 | 306 | |
307 | 307 | public function getMount($data) { |
308 | 308 | $data['manager'] = $this; |
309 | - $mountPoint = '/' . $this->uid . '/files' . $data['mountpoint']; |
|
309 | + $mountPoint = '/'.$this->uid.'/files'.$data['mountpoint']; |
|
310 | 310 | $data['mountpoint'] = $mountPoint; |
311 | 311 | $data['certificateManager'] = \OC::$server->getCertificateManager($this->uid); |
312 | 312 | return new Mount(self::STORAGE, $mountPoint, $data, $this, $this->storageLoader); |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | WHERE `mountpoint_hash` = ? |
347 | 347 | AND `user` = ? |
348 | 348 | '); |
349 | - $result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid)); |
|
349 | + $result = (bool) $query->execute(array($target, $targetHash, $sourceHash, $this->uid)); |
|
350 | 350 | |
351 | 351 | return $result; |
352 | 352 | } |
@@ -376,9 +376,9 @@ discard block |
||
376 | 376 | WHERE `mountpoint_hash` = ? |
377 | 377 | AND `user` = ? |
378 | 378 | '); |
379 | - $result = (bool)$query->execute(array($hash, $this->uid)); |
|
379 | + $result = (bool) $query->execute(array($hash, $this->uid)); |
|
380 | 380 | |
381 | - if($result) { |
|
381 | + if ($result) { |
|
382 | 382 | $this->removeReShares($id); |
383 | 383 | } |
384 | 384 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | |
400 | 400 | |
401 | 401 | $query->delete('federated_reshares') |
402 | - ->where($query->expr()->in('share_id', $query->createFunction('(' . $select . ')'))); |
|
402 | + ->where($query->expr()->in('share_id', $query->createFunction('('.$select.')'))); |
|
403 | 403 | $query->execute(); |
404 | 404 | |
405 | 405 | $deleteReShares = $this->connection->getQueryBuilder(); |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | |
424 | 424 | if ($result) { |
425 | 425 | $shares = $getShare->fetchAll(); |
426 | - foreach($shares as $share) { |
|
426 | + foreach ($shares as $share) { |
|
427 | 427 | $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline'); |
428 | 428 | } |
429 | 429 | } |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | DELETE FROM `*PREFIX*share_external` |
433 | 433 | WHERE `user` = ? |
434 | 434 | '); |
435 | - return (bool)$query->execute(array($uid)); |
|
435 | + return (bool) $query->execute(array($uid)); |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | /** |
@@ -362,77 +362,77 @@ |
||
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 |
@@ -1,12 +1,12 @@ |
||
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> |
@@ -64,7 +64,7 @@ |
||
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(), |
@@ -95,7 +95,7 @@ discard block |
||
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 |
||
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(), |