@@ -33,10 +33,10 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | // Prevent writing invalid mtime (timezone-proof) |
36 | - if ((int)$mtimeFromRequest <= 24 * 60 * 60) { |
|
36 | + if ((int) $mtimeFromRequest <= 24 * 60 * 60) { |
|
37 | 37 | throw new \InvalidArgumentException('X-OC-MTime header must be a valid positive integer'); |
38 | 38 | } |
39 | 39 | |
40 | - return (int)$mtimeFromRequest; |
|
40 | + return (int) $mtimeFromRequest; |
|
41 | 41 | } |
42 | 42 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | if (isset($parsedUrl['port']) && $parsedUrl['port']) { |
73 | - return $this->isTrustedDomain($parsedUrl['host'] . ':' . $parsedUrl['port']); |
|
73 | + return $this->isTrustedDomain($parsedUrl['host'].':'.$parsedUrl['port']); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $this->isTrustedDomain($parsedUrl['host']); |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | if (gettype($trusted) !== 'string') { |
107 | 107 | break; |
108 | 108 | } |
109 | - $regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function ($v) { |
|
109 | + $regex = '/^'.implode('[-\.a-zA-Z0-9]*', array_map(function($v) { |
|
110 | 110 | return preg_quote($v, '/'); |
111 | - }, explode('*', $trusted))) . '$/i'; |
|
111 | + }, explode('*', $trusted))).'$/i'; |
|
112 | 112 | if (preg_match($regex, $domain) || preg_match($regex, $domainWithPort)) { |
113 | 113 | return true; |
114 | 114 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function getPath(string $user, string $path): string { |
96 | 96 | $node = $this->rootFolder->getUserFolder($user)->get($path); |
97 | - return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/')); |
|
97 | + return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/')); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | try { |
127 | 127 | $lockingProvider->acquireLock($path, $type); |
128 | - $this->config->setAppValue('testing', 'locking_' . $path, (string)$type); |
|
128 | + $this->config->setAppValue('testing', 'locking_'.$path, (string) $type); |
|
129 | 129 | return new DataResponse(); |
130 | 130 | } catch (LockedException $e) { |
131 | 131 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | try { |
150 | 150 | $lockingProvider->changeLock($path, $type); |
151 | - $this->config->setAppValue('testing', 'locking_' . $path, (string)$type); |
|
151 | + $this->config->setAppValue('testing', 'locking_'.$path, (string) $type); |
|
152 | 152 | return new DataResponse(); |
153 | 153 | } catch (LockedException $e) { |
154 | 154 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | try { |
173 | 173 | $lockingProvider->releaseLock($path, $type); |
174 | - $this->config->deleteAppValue('testing', 'locking_' . $path); |
|
174 | + $this->config->deleteAppValue('testing', 'locking_'.$path); |
|
175 | 175 | return new DataResponse(); |
176 | 176 | } catch (LockedException $e) { |
177 | 177 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | if (strpos($lock, 'locking_') === 0) { |
207 | 207 | $path = substr($lock, strlen('locking_')); |
208 | 208 | |
209 | - if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
210 | - $lockingProvider->releaseLock($path, (int)$this->config->getAppValue('testing', $lock)); |
|
211 | - } elseif ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
212 | - $lockingProvider->releaseLock($path, (int)$this->config->getAppValue('testing', $lock)); |
|
209 | + if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
210 | + $lockingProvider->releaseLock($path, (int) $this->config->getAppValue('testing', $lock)); |
|
211 | + } elseif ($type === ILockingProvider::LOCK_SHARED && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
212 | + $lockingProvider->releaseLock($path, (int) $this->config->getAppValue('testing', $lock)); |
|
213 | 213 | } else { |
214 | - $lockingProvider->releaseLock($path, (int)$this->config->getAppValue('testing', $lock)); |
|
214 | + $lockingProvider->releaseLock($path, (int) $this->config->getAppValue('testing', $lock)); |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | } |
@@ -214,7 +214,7 @@ |
||
214 | 214 | |
215 | 215 | while ($nextcloudId = array_shift($idList)) { |
216 | 216 | $update->setParameter('nextcloudId', $nextcloudId); |
217 | - $update->setParameter('invalidatedUuid', 'invalidated_' . \bin2hex(\random_bytes(6))); |
|
217 | + $update->setParameter('invalidatedUuid', 'invalidated_'.\bin2hex(\random_bytes(6))); |
|
218 | 218 | try { |
219 | 219 | $update->executeStatement(); |
220 | 220 | $this->logger->warning( |
@@ -128,12 +128,12 @@ discard block |
||
128 | 128 | |
129 | 129 | sort($serverConnections); |
130 | 130 | $lastKey = array_pop($serverConnections); |
131 | - $lastNumber = (int)str_replace('s', '', $lastKey); |
|
132 | - return 's' . str_pad((string)($lastNumber + 1), 2, '0', STR_PAD_LEFT); |
|
131 | + $lastNumber = (int) str_replace('s', '', $lastKey); |
|
132 | + return 's'.str_pad((string) ($lastNumber + 1), 2, '0', STR_PAD_LEFT); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | private function getServersConfig(string $value): array { |
136 | - $regex = '/' . $value . '$/S'; |
|
136 | + $regex = '/'.$value.'$/S'; |
|
137 | 137 | |
138 | 138 | $keys = $this->config->getAppKeys('user_ldap'); |
139 | 139 | $result = []; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $query = $this->connection->getQueryBuilder(); |
161 | 161 | $query->delete('appconfig') |
162 | 162 | ->where($query->expr()->eq('appid', $query->createNamedParameter('user_ldap'))) |
163 | - ->andWhere($query->expr()->like('configkey', $query->createNamedParameter((string)$prefix . '%'))) |
|
163 | + ->andWhere($query->expr()->like('configkey', $query->createNamedParameter((string) $prefix.'%'))) |
|
164 | 164 | ->andWhere($query->expr()->notIn('configkey', $query->createNamedParameter([ |
165 | 165 | 'enabled', |
166 | 166 | 'installed_version', |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | if (!is_string($dn)) { |
228 | - throw new \LogicException('String expected ' . \gettype($dn) . ' given'); |
|
228 | + throw new \LogicException('String expected '.\gettype($dn).' given'); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | if (($sanitizedDn = $this->sanitizeDnCache->get($dn)) !== null) { |
@@ -53,6 +53,6 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | public function getPath(): string { |
56 | - return $this->getMountPoint() . $this->getInternalPath(); |
|
56 | + return $this->getMountPoint().$this->getInternalPath(); |
|
57 | 57 | } |
58 | 58 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | foreach ($directoryRange as $child) { |
68 | 68 | $mountPoints[] = new MountPoint( |
69 | 69 | AppdataPreviewObjectStoreStorage::class, |
70 | - '/appdata_' . $instanceId . '/preview/' . $parent . '/' . $child, |
|
70 | + '/appdata_'.$instanceId.'/preview/'.$parent.'/'.$child, |
|
71 | 71 | $this->getMultiBucketObjectStore($i), |
72 | 72 | $loader, |
73 | 73 | null, |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | $fakeRootStorage = new ObjectStoreStorage($rootStorageArguments); |
83 | 83 | $fakeRootStorageJail = new Jail([ |
84 | 84 | 'storage' => $fakeRootStorage, |
85 | - 'root' => '/appdata_' . $instanceId . '/preview', |
|
85 | + 'root' => '/appdata_'.$instanceId.'/preview', |
|
86 | 86 | ]); |
87 | 87 | |
88 | 88 | // add a fallback location to be able to fetch existing previews from the old bucket |
89 | 89 | $mountPoints[] = new MountPoint( |
90 | 90 | $fakeRootStorageJail, |
91 | - '/appdata_' . $instanceId . '/preview/old-multibucket', |
|
91 | + '/appdata_'.$instanceId.'/preview/old-multibucket', |
|
92 | 92 | null, |
93 | 93 | $loader, |
94 | 94 | null, |
@@ -78,7 +78,7 @@ |
||
78 | 78 | * @param string $userSearch the pattern users are search for |
79 | 79 | */ |
80 | 80 | public function get(string $groupSearch = '', string $userSearch = ''): array { |
81 | - $key = $groupSearch . '::' . $userSearch; |
|
81 | + $key = $groupSearch.'::'.$userSearch; |
|
82 | 82 | if (isset($this->metaData[$key])) { |
83 | 83 | return $this->metaData[$key]; |
84 | 84 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $logFile = $config->getSystemValueString('logfile_audit', ''); |
43 | 43 | |
44 | 44 | if ($auditType === 'file' && !$logFile) { |
45 | - $default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/audit.log'; |
|
45 | + $default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/audit.log'; |
|
46 | 46 | // Legacy way was appconfig, now it's paralleled with the normal log config |
47 | 47 | $logFile = $config->getAppValue('admin_audit', 'logfile', $default); |
48 | 48 | } |