@@ -71,7 +71,7 @@ |
||
71 | 71 | public function getChild($name) { |
72 | 72 | $userFolder = $this->rootFolder->getUserFolder($this->user->getUID()); |
73 | 73 | |
74 | - $fileId = (int)$name; |
|
74 | + $fileId = (int) $name; |
|
75 | 75 | $nodes = $userFolder->getById($fileId); |
76 | 76 | |
77 | 77 | if ($nodes === []) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | public function getETag(): string { |
63 | - return (string)$this->version->getRevisionId(); |
|
63 | + return (string) $this->version->getRevisionId(); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function getSize(): int { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | public function getName(): string { |
75 | - return (string)$this->version->getRevisionId(); |
|
75 | + return (string) $this->version->getRevisionId(); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | public function setName($name) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function getChildren(): array { |
79 | 79 | $versions = $this->versionManager->getVersionsForFile($this->user, $this->file); |
80 | 80 | |
81 | - return array_map(function (IVersion $version) { |
|
81 | + return array_map(function(IVersion $version) { |
|
82 | 82 | return new VersionFile($version, $this->versionManager); |
83 | 83 | }, $versions); |
84 | 84 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | public function getName(): string { |
100 | - return (string)$this->file->getId(); |
|
100 | + return (string) $this->file->getId(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | public function setName($name) { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | try { |
84 | 84 | $this->manager->getAppPath($singleAppId); |
85 | 85 | } catch (\OCP\App\AppPathNotFoundException $e) { |
86 | - $output->writeln($singleAppId . ' not installed'); |
|
86 | + $output->writeln($singleAppId.' not installed'); |
|
87 | 87 | return 1; |
88 | 88 | } |
89 | 89 | |
@@ -98,22 +98,22 @@ discard block |
||
98 | 98 | foreach ($apps as $appId) { |
99 | 99 | $newVersion = $this->installer->isUpdateAvailable($appId); |
100 | 100 | if ($newVersion) { |
101 | - $output->writeln($appId . ' new version available: ' . $newVersion); |
|
101 | + $output->writeln($appId.' new version available: '.$newVersion); |
|
102 | 102 | |
103 | 103 | if (!$input->getOption('showonly')) { |
104 | 104 | try { |
105 | 105 | $result = $this->installer->updateAppstoreApp($appId); |
106 | - } catch(\Exception $e) { |
|
107 | - $this->logger->logException($e, ['message' => 'Failure during update of app "' . $appId . '"','app' => 'app:update']); |
|
108 | - $output->writeln('Error: ' . $e->getMessage()); |
|
106 | + } catch (\Exception $e) { |
|
107 | + $this->logger->logException($e, ['message' => 'Failure during update of app "'.$appId.'"', 'app' => 'app:update']); |
|
108 | + $output->writeln('Error: '.$e->getMessage()); |
|
109 | 109 | $return = 1; |
110 | 110 | } |
111 | 111 | |
112 | 112 | if ($result === false) { |
113 | - $output->writeln($appId . ' couldn\'t be updated'); |
|
113 | + $output->writeln($appId.' couldn\'t be updated'); |
|
114 | 114 | $return = 1; |
115 | - } else if($result === true) { |
|
116 | - $output->writeln($appId . ' updated'); |
|
115 | + } else if ($result === true) { |
|
116 | + $output->writeln($appId.' updated'); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | } |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | */ |
171 | 171 | private function requiresCSRFCheck() { |
172 | 172 | // GET requires no check at all |
173 | - if($this->request->getMethod() === 'GET') { |
|
173 | + if ($this->request->getMethod() === 'GET') { |
|
174 | 174 | return false; |
175 | 175 | } |
176 | 176 | |
177 | 177 | // Official Nextcloud clients require no checks |
178 | - if($this->request->isUserAgent([ |
|
178 | + if ($this->request->isUserAgent([ |
|
179 | 179 | IRequest::USER_AGENT_CLIENT_DESKTOP, |
180 | 180 | IRequest::USER_AGENT_CLIENT_ANDROID, |
181 | 181 | IRequest::USER_AGENT_CLIENT_IOS, |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | // If not logged-in no check is required |
187 | - if(!$this->userSession->isLoggedIn()) { |
|
187 | + if (!$this->userSession->isLoggedIn()) { |
|
188 | 188 | return false; |
189 | 189 | } |
190 | 190 | |
191 | 191 | // POST always requires a check |
192 | - if($this->request->getMethod() === 'POST') { |
|
192 | + if ($this->request->getMethod() === 'POST') { |
|
193 | 193 | return true; |
194 | 194 | } |
195 | 195 | |
196 | 196 | // If logged-in AND DAV authenticated no check is required |
197 | - if($this->userSession->isLoggedIn() && |
|
197 | + if ($this->userSession->isLoggedIn() && |
|
198 | 198 | $this->isDavAuthenticated($this->userSession->getUser()->getUID())) { |
199 | 199 | return false; |
200 | 200 | } |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | private function auth(RequestInterface $request, ResponseInterface $response) { |
212 | 212 | $forcedLogout = false; |
213 | 213 | |
214 | - if(!$this->request->passesCSRFCheck() && |
|
214 | + if (!$this->request->passesCSRFCheck() && |
|
215 | 215 | $this->requiresCSRFCheck()) { |
216 | 216 | // In case of a fail with POST we need to recheck the credentials |
217 | - if($this->request->getMethod() === 'POST') { |
|
217 | + if ($this->request->getMethod() === 'POST') { |
|
218 | 218 | $forcedLogout = true; |
219 | 219 | } else { |
220 | 220 | $response->setStatus(401); |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | } |
223 | 223 | } |
224 | 224 | |
225 | - if($forcedLogout) { |
|
225 | + if ($forcedLogout) { |
|
226 | 226 | $this->userSession->logout(); |
227 | 227 | } else { |
228 | - if($this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) { |
|
228 | + if ($this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) { |
|
229 | 229 | throw new \Sabre\DAV\Exception\NotAuthenticated('2FA challenge not passed.'); |
230 | 230 | } |
231 | 231 | if ( |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | \OC_Util::setupFS($user); |
240 | 240 | $this->currentUser = $user; |
241 | 241 | $this->session->close(); |
242 | - return [true, $this->principalPrefix . $user]; |
|
242 | + return [true, $this->principalPrefix.$user]; |
|
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
246 | 246 | if (!$this->userSession->isLoggedIn() && in_array('XMLHttpRequest', explode(',', $request->getHeader('X-Requested-With')))) { |
247 | 247 | // do not re-authenticate over ajax, use dummy auth name to prevent browser popup |
248 | - $response->addHeader('WWW-Authenticate','DummyBasic realm="' . $this->realm . '"'); |
|
248 | + $response->addHeader('WWW-Authenticate', 'DummyBasic realm="'.$this->realm.'"'); |
|
249 | 249 | $response->setStatus(401); |
250 | 250 | throw new \Sabre\DAV\Exception\NotAuthenticated('Cannot authenticate over ajax calls'); |
251 | 251 | } |
252 | 252 | |
253 | 253 | $data = parent::check($request, $response); |
254 | - if($data[0] === true) { |
|
254 | + if ($data[0] === true) { |
|
255 | 255 | $startPos = strrpos($data[1], '/') + 1; |
256 | 256 | $user = $this->userSession->getUser()->getUID(); |
257 | 257 | $data[1] = substr_replace($data[1], $user, $startPos); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | <?php if (!$_['isIE']) { ?> |
6 | 6 | <input type="checkbox" class="hidden-visually" id="showgridview" |
7 | - <?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/> |
|
7 | + <?php if ($_['showgridview']) { ?>checked="checked" <?php } ?>/> |
|
8 | 8 | <label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>" |
9 | 9 | title="<?php p($l->t('Toggle grid view'))?>"></label> |
10 | 10 | <?php } ?> |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if ($path === '') { |
60 | 60 | return $this->getRoot(); |
61 | 61 | } else { |
62 | - return $this->getRoot() . '/' . ltrim($path, '/'); |
|
62 | + return $this->getRoot().'/'.ltrim($path, '/'); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $rootLength = strlen($this->getRoot()) + 1; |
75 | 75 | if ($path === $this->getRoot()) { |
76 | 76 | return ''; |
77 | - } else if (substr($path, 0, $rootLength) === $this->getRoot() . '/') { |
|
77 | + } else if (substr($path, 0, $rootLength) === $this->getRoot().'/') { |
|
78 | 78 | return substr($path, $rootLength); |
79 | 79 | } else { |
80 | 80 | return null; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | protected function filterCacheEntry($entry) { |
96 | 96 | $rootLength = strlen($this->getRoot()) + 1; |
97 | - return $rootLength === 1 || ($entry['path'] === $this->getRoot()) || (substr($entry['path'], 0, $rootLength) === $this->getRoot() . '/'); |
|
97 | + return $rootLength === 1 || ($entry['path'] === $this->getRoot()) || (substr($entry['path'], 0, $rootLength) === $this->getRoot().'/'); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | |
216 | 216 | protected function authSucceeded() { |
217 | 217 | // For share this was always set so it is still used in other apps |
218 | - $this->session->set('public_link_authenticated', (string)$this->share->getId()); |
|
218 | + $this->session->set('public_link_authenticated', (string) $this->share->getId()); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | protected function authFailed() { |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $itemType = $itemSource = $uidOwner = ''; |
237 | 237 | $token = $share; |
238 | 238 | $exception = null; |
239 | - if($share instanceof \OCP\Share\IShare) { |
|
239 | + if ($share instanceof \OCP\Share\IShare) { |
|
240 | 240 | try { |
241 | 241 | $token = $share->getToken(); |
242 | 242 | $uidOwner = $share->getSharedBy(); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | 'errorCode' => $errorCode, |
256 | 256 | 'errorMessage' => $errorMessage, |
257 | 257 | ]); |
258 | - if(!is_null($exception)) { |
|
258 | + if (!is_null($exception)) { |
|
259 | 259 | throw $exception; |
260 | 260 | } |
261 | 261 | } |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $shareTmpl['previewURL'] = $shareTmpl['downloadURL']; |
386 | 386 | |
387 | 387 | if ($shareTmpl['previewSupported']) { |
388 | - $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'files_sharing.PublicPreview.getPreview', |
|
388 | + $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.PublicPreview.getPreview', |
|
389 | 389 | ['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 'token' => $shareTmpl['dirToken']]); |
390 | 390 | $ogPreview = $shareTmpl['previewImage']; |
391 | 391 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | |
437 | 437 | // OpenGraph Support: http://ogp.me/ |
438 | 438 | \OCP\Util::addHeader('meta', ['property' => "og:title", 'content' => $shareTmpl['filename']]); |
439 | - \OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $this->defaults->getName() . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : '')]); |
|
439 | + \OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $this->defaults->getName().($this->defaults->getSlogan() !== '' ? ' - '.$this->defaults->getSlogan() : '')]); |
|
440 | 440 | \OCP\Util::addHeader('meta', ['property' => "og:site_name", 'content' => $this->defaults->getName()]); |
441 | 441 | \OCP\Util::addHeader('meta', ['property' => "og:url", 'content' => $shareTmpl['shareUrl']]); |
442 | 442 | \OCP\Util::addHeader('meta', ['property' => "og:type", 'content' => "object"]); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | |
487 | 487 | $share = $this->shareManager->getShareByToken($token); |
488 | 488 | |
489 | - if(!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { |
|
489 | + if (!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) { |
|
490 | 490 | return new \OCP\AppFramework\Http\DataResponse('Share is read-only'); |
491 | 491 | } |
492 | 492 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | |
565 | 565 | $this->emitAccessShareHook($share); |
566 | 566 | |
567 | - $server_params = array( 'head' => $this->request->getMethod() === 'HEAD' ); |
|
567 | + $server_params = array('head' => $this->request->getMethod() === 'HEAD'); |
|
568 | 568 | |
569 | 569 | /** |
570 | 570 | * Http range requests support |
@@ -213,18 +213,18 @@ |
||
213 | 213 | continue; |
214 | 214 | } |
215 | 215 | |
216 | - $pattern = '/(^|\s)(' . '@' . $mention['id'] . ')(\b)/'; |
|
216 | + $pattern = '/(^|\s)('.'@'.$mention['id'].')(\b)/'; |
|
217 | 217 | if (strpos($mention['id'], ' ') !== false) { |
218 | - $pattern = '/(^|\s)(' . '@"' . $mention['id'] . '"' . ')(\b)?/'; |
|
218 | + $pattern = '/(^|\s)('.'@"'.$mention['id'].'"'.')(\b)?/'; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | $message = preg_replace( |
222 | 222 | $pattern, |
223 | 223 | //'${1}' . $this->regexSafeUser($mention['id'], $displayName) . '${3}', |
224 | - '${1}' . '{mention' . $mentionCount . '}' . '${3}', |
|
224 | + '${1}'.'{mention'.$mentionCount.'}'.'${3}', |
|
225 | 225 | $message |
226 | 226 | ); |
227 | - $mentions['mention' . $mentionCount] = $this->generateUserParameter($mention['id']); |
|
227 | + $mentions['mention'.$mentionCount] = $this->generateUserParameter($mention['id']); |
|
228 | 228 | $mentionCount++; |
229 | 229 | } |
230 | 230 |