@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | try { |
| 311 | 311 | $serializer = $this->getSerializer(); |
| 312 | 312 | } catch (Throwable $e) { |
| 313 | - $this->error("Failed to load ExceptionSerializer serializer while trying to log " . $exception->getMessage()); |
|
| 313 | + $this->error("Failed to load ExceptionSerializer serializer while trying to log ".$exception->getMessage()); |
|
| 314 | 314 | return; |
| 315 | 315 | } |
| 316 | 316 | $data = $context; |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | $context['level'] = $level; |
| 360 | 360 | } catch (Throwable $e) { |
| 361 | 361 | // make sure we dont hard crash if logging fails |
| 362 | - error_log('Error when trying to log exception: ' . $e->getMessage() . ' ' . $e->getTraceAsString()); |
|
| 362 | + error_log('Error when trying to log exception: '.$e->getMessage().' '.$e->getTraceAsString()); |
|
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | $replace = []; |
| 391 | 391 | $usedContextKeys = []; |
| 392 | 392 | foreach ($context as $key => $val) { |
| 393 | - $fullKey = '{' . $key . '}'; |
|
| 393 | + $fullKey = '{'.$key.'}'; |
|
| 394 | 394 | $replace[$fullKey] = $val; |
| 395 | 395 | if (str_contains($message, $fullKey)) { |
| 396 | 396 | $usedContextKeys[$key] = true; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $this->navigationManager = \OC::$server->get(INavigationManager::class); |
| 99 | 99 | |
| 100 | 100 | parent::__construct('core', 'layout.user'); |
| 101 | - if (in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { |
|
| 101 | + if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) { |
|
| 102 | 102 | $this->assign('bodyid', 'body-settings'); |
| 103 | 103 | } else { |
| 104 | 104 | $this->assign('bodyid', 'body-user'); |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $this->initialState->provideInitialState('core', 'active-app', $this->navigationManager->getActiveEntry()); |
| 108 | 108 | $this->initialState->provideInitialState('core', 'apps', $this->navigationManager->getAll()); |
| 109 | - $this->initialState->provideInitialState('unified-search', 'limit-default', (int)$this->config->getAppValue('core', 'unified-search.limit-default', (string)SearchQuery::LIMIT_DEFAULT)); |
|
| 110 | - $this->initialState->provideInitialState('unified-search', 'min-search-length', (int)$this->config->getAppValue('core', 'unified-search.min-search-length', (string)1)); |
|
| 109 | + $this->initialState->provideInitialState('unified-search', 'limit-default', (int) $this->config->getAppValue('core', 'unified-search.limit-default', (string) SearchQuery::LIMIT_DEFAULT)); |
|
| 110 | + $this->initialState->provideInitialState('unified-search', 'min-search-length', (int) $this->config->getAppValue('core', 'unified-search.min-search-length', (string) 1)); |
|
| 111 | 111 | $this->initialState->provideInitialState('unified-search', 'live-search', $this->config->getAppValue('core', 'unified-search.live-search', 'yes') === 'yes'); |
| 112 | 112 | Util::addScript('core', 'unified-search', 'core'); |
| 113 | 113 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | foreach ($jsFiles as $info) { |
| 248 | 248 | $web = $info[1]; |
| 249 | 249 | $file = $info[2]; |
| 250 | - $this->append('jsfiles', $web.'/'.$file . $this->getVersionHashSuffix()); |
|
| 250 | + $this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | try { |
@@ -280,14 +280,14 @@ discard block |
||
| 280 | 280 | $file = $info[2]; |
| 281 | 281 | |
| 282 | 282 | if (substr($file, -strlen('print.css')) === 'print.css') { |
| 283 | - $this->append('printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix()); |
|
| 283 | + $this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
| 284 | 284 | } else { |
| 285 | 285 | $suffix = $this->getVersionHashSuffix($web, $file); |
| 286 | 286 | |
| 287 | 287 | if (!str_contains($file, '?v=')) { |
| 288 | - $this->append('cssfiles', $web.'/'.$file . $suffix); |
|
| 288 | + $this->append('cssfiles', $web.'/'.$file.$suffix); |
|
| 289 | 289 | } else { |
| 290 | - $this->append('cssfiles', $web.'/'.$file . '-' . substr($suffix, 3)); |
|
| 290 | + $this->append('cssfiles', $web.'/'.$file.'-'.substr($suffix, 3)); |
|
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | if ($this->config->getSystemValueBool('installed', false)) { |
| 315 | 315 | if (\OC::$server->getAppManager()->isInstalled('theming')) { |
| 316 | - $themingSuffix = '-' . $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
| 316 | + $themingSuffix = '-'.$this->config->getAppValue('theming', 'cachebuster', '0'); |
|
| 317 | 317 | } |
| 318 | 318 | $v = \OC_App::getAppVersions(); |
| 319 | 319 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | $appName = $this->getAppNamefromPath($path); |
| 324 | 324 | if (array_key_exists($appName, $v)) { |
| 325 | 325 | $appVersion = $v[$appName]; |
| 326 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
| 326 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | // fallback to the file path instead |
@@ -331,11 +331,11 @@ discard block |
||
| 331 | 331 | $appName = $this->getAppNamefromPath($file); |
| 332 | 332 | if (array_key_exists($appName, $v)) { |
| 333 | 333 | $appVersion = $v[$appName]; |
| 334 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
| 334 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - return '?v=' . self::$versionHash . $themingSuffix; |
|
| 338 | + return '?v='.self::$versionHash.$themingSuffix; |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | /** |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | if (!is_array($supportedArchitectures)) { |
| 187 | 187 | $supportedArchitectures = [$supportedArchitectures]; |
| 188 | 188 | } |
| 189 | - $supportedArchitectures = array_map(function ($architecture) { |
|
| 189 | + $supportedArchitectures = array_map(function($architecture) { |
|
| 190 | 190 | return $this->getValue($architecture); |
| 191 | 191 | }, $supportedArchitectures); |
| 192 | 192 | $currentArchitecture = $this->platform->getArchitecture(); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | if (!is_array($supportedDatabases)) { |
| 214 | 214 | $supportedDatabases = [$supportedDatabases]; |
| 215 | 215 | } |
| 216 | - $supportedDatabases = array_map(function ($db) { |
|
| 216 | + $supportedDatabases = array_map(function($db) { |
|
| 217 | 217 | return $this->getValue($db); |
| 218 | 218 | }, $supportedDatabases); |
| 219 | 219 | $currentDatabase = $this->platform->getDatabase(); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | return $missing; |
| 314 | 314 | } |
| 315 | 315 | if (is_array($oss)) { |
| 316 | - $oss = array_map(function ($os) { |
|
| 316 | + $oss = array_map(function($os) { |
|
| 317 | 317 | return $this->getValue($os); |
| 318 | 318 | }, $oss); |
| 319 | 319 | } else { |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | return '10'; |
| 385 | 385 | default: |
| 386 | 386 | if (str_starts_with($version, '9.1.')) { |
| 387 | - $version = '10.0.' . substr($version, 4); |
|
| 387 | + $version = '10.0.'.substr($version, 4); |
|
| 388 | 388 | } |
| 389 | 389 | return $version; |
| 390 | 390 | } |
@@ -398,6 +398,6 @@ discard block |
||
| 398 | 398 | if (isset($element['@value'])) { |
| 399 | 399 | return $element['@value']; |
| 400 | 400 | } |
| 401 | - return (string)$element; |
|
| 401 | + return (string) $element; |
|
| 402 | 402 | } |
| 403 | 403 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function getTableNamesWithoutPrefix() { |
| 63 | 63 | $tableNames = $this->schema->getTableNames(); |
| 64 | - return array_map(function ($tableName) { |
|
| 64 | + return array_map(function($tableName) { |
|
| 65 | 65 | if (str_starts_with($tableName, $this->connection->getPrefix())) { |
| 66 | 66 | return substr($tableName, strlen($this->connection->getPrefix())); |
| 67 | 67 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @throws \Doctrine\DBAL\Schema\SchemaException |
| 87 | 87 | */ |
| 88 | 88 | public function getTable($tableName) { |
| 89 | - return $this->schema->getTable($this->connection->getPrefix() . $tableName); |
|
| 89 | + return $this->schema->getTable($this->connection->getPrefix().$tableName); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @return boolean |
| 98 | 98 | */ |
| 99 | 99 | public function hasTable($tableName) { |
| 100 | - return $this->schema->hasTable($this->connection->getPrefix() . $tableName); |
|
| 100 | + return $this->schema->hasTable($this->connection->getPrefix().$tableName); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function createTable($tableName) { |
| 110 | 110 | unset($this->tablesToDelete[$tableName]); |
| 111 | - return $this->schema->createTable($this->connection->getPrefix() . $tableName); |
|
| 111 | + return $this->schema->createTable($this->connection->getPrefix().$tableName); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function dropTable($tableName) { |
| 121 | 121 | $this->tablesToDelete[$tableName] = true; |
| 122 | - return $this->schema->dropTable($this->connection->getPrefix() . $tableName); |
|
| 122 | + return $this->schema->dropTable($this->connection->getPrefix().$tableName); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | $route = substr($route, 7); |
| 127 | - $route = '/ocs/v2.php' . $route; |
|
| 127 | + $route = '/ocs/v2.php'.$route; |
|
| 128 | 128 | |
| 129 | 129 | return $this->getAbsoluteURL($route); |
| 130 | 130 | } |
@@ -146,33 +146,33 @@ discard block |
||
| 146 | 146 | if ($appName !== '') { |
| 147 | 147 | $app_path = $this->getAppManager()->getAppPath($appName); |
| 148 | 148 | // Check if the app is in the app folder |
| 149 | - if (file_exists($app_path . '/' . $file)) { |
|
| 149 | + if (file_exists($app_path.'/'.$file)) { |
|
| 150 | 150 | if (substr($file, -3) === 'php') { |
| 151 | - $urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $appName; |
|
| 151 | + $urlLinkTo = \OC::$WEBROOT.'/index.php/apps/'.$appName; |
|
| 152 | 152 | if ($frontControllerActive) { |
| 153 | - $urlLinkTo = \OC::$WEBROOT . '/apps/' . $appName; |
|
| 153 | + $urlLinkTo = \OC::$WEBROOT.'/apps/'.$appName; |
|
| 154 | 154 | } |
| 155 | - $urlLinkTo .= ($file !== 'index.php') ? '/' . $file : ''; |
|
| 155 | + $urlLinkTo .= ($file !== 'index.php') ? '/'.$file : ''; |
|
| 156 | 156 | } else { |
| 157 | - $urlLinkTo = $this->getAppManager()->getAppWebPath($appName) . '/' . $file; |
|
| 157 | + $urlLinkTo = $this->getAppManager()->getAppWebPath($appName).'/'.$file; |
|
| 158 | 158 | } |
| 159 | 159 | } else { |
| 160 | - $urlLinkTo = \OC::$WEBROOT . '/' . $appName . '/' . $file; |
|
| 160 | + $urlLinkTo = \OC::$WEBROOT.'/'.$appName.'/'.$file; |
|
| 161 | 161 | } |
| 162 | 162 | } else { |
| 163 | - if (file_exists(\OC::$SERVERROOT . '/core/' . $file)) { |
|
| 164 | - $urlLinkTo = \OC::$WEBROOT . '/core/' . $file; |
|
| 163 | + if (file_exists(\OC::$SERVERROOT.'/core/'.$file)) { |
|
| 164 | + $urlLinkTo = \OC::$WEBROOT.'/core/'.$file; |
|
| 165 | 165 | } else { |
| 166 | 166 | if ($frontControllerActive && $file === 'index.php') { |
| 167 | - $urlLinkTo = \OC::$WEBROOT . '/'; |
|
| 167 | + $urlLinkTo = \OC::$WEBROOT.'/'; |
|
| 168 | 168 | } else { |
| 169 | - $urlLinkTo = \OC::$WEBROOT . '/' . $file; |
|
| 169 | + $urlLinkTo = \OC::$WEBROOT.'/'.$file; |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | if ($args && $query = http_build_query($args, '', '&')) { |
| 175 | - $urlLinkTo .= '?' . $query; |
|
| 175 | + $urlLinkTo .= '?'.$query; |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | return $urlLinkTo; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $appName = 'core'; |
| 209 | 209 | $appPath = false; |
| 210 | 210 | } else { |
| 211 | - throw new RuntimeException('image not found: image: ' . $file . ' webroot: ' . \OC::$WEBROOT . ' serverroot: ' . \OC::$SERVERROOT); |
|
| 211 | + throw new RuntimeException('image not found: image: '.$file.' webroot: '.\OC::$WEBROOT.' serverroot: '.\OC::$SERVERROOT); |
|
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
@@ -223,38 +223,38 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$appName/img/$file")) { |
|
| 227 | - $path = \OC::$WEBROOT . "/themes/$theme/apps/$appName/img/$file"; |
|
| 228 | - } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$appName/img/$basename.svg") |
|
| 229 | - && file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$appName/img/$basename.png")) { |
|
| 230 | - $path = \OC::$WEBROOT . "/themes/$theme/apps/$appName/img/$basename.png"; |
|
| 231 | - } elseif (!empty($appName) and file_exists(\OC::$SERVERROOT . "/themes/$theme/$appName/img/$file")) { |
|
| 232 | - $path = \OC::$WEBROOT . "/themes/$theme/$appName/img/$file"; |
|
| 233 | - } elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT . "/themes/$theme/$appName/img/$basename.svg") |
|
| 234 | - && file_exists(\OC::$SERVERROOT . "/themes/$theme/$appName/img/$basename.png"))) { |
|
| 235 | - $path = \OC::$WEBROOT . "/themes/$theme/$appName/img/$basename.png"; |
|
| 236 | - } elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$file")) { |
|
| 237 | - $path = \OC::$WEBROOT . "/themes/$theme/core/img/$file"; |
|
| 238 | - } elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.svg") |
|
| 239 | - && file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.png")) { |
|
| 240 | - $path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png"; |
|
| 226 | + if (file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$appName/img/$file")) { |
|
| 227 | + $path = \OC::$WEBROOT."/themes/$theme/apps/$appName/img/$file"; |
|
| 228 | + } elseif (!file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$appName/img/$basename.svg") |
|
| 229 | + && file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$appName/img/$basename.png")) { |
|
| 230 | + $path = \OC::$WEBROOT."/themes/$theme/apps/$appName/img/$basename.png"; |
|
| 231 | + } elseif (!empty($appName) and file_exists(\OC::$SERVERROOT."/themes/$theme/$appName/img/$file")) { |
|
| 232 | + $path = \OC::$WEBROOT."/themes/$theme/$appName/img/$file"; |
|
| 233 | + } elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT."/themes/$theme/$appName/img/$basename.svg") |
|
| 234 | + && file_exists(\OC::$SERVERROOT."/themes/$theme/$appName/img/$basename.png"))) { |
|
| 235 | + $path = \OC::$WEBROOT."/themes/$theme/$appName/img/$basename.png"; |
|
| 236 | + } elseif (file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$file")) { |
|
| 237 | + $path = \OC::$WEBROOT."/themes/$theme/core/img/$file"; |
|
| 238 | + } elseif (!file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$basename.svg") |
|
| 239 | + && file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$basename.png")) { |
|
| 240 | + $path = \OC::$WEBROOT."/themes/$theme/core/img/$basename.png"; |
|
| 241 | 241 | } elseif ($themingEnabled && $themingImagePath) { |
| 242 | 242 | $path = $themingImagePath; |
| 243 | - } elseif ($appPath && file_exists($appPath . "/img/$file")) { |
|
| 244 | - $path = $this->getAppManager()->getAppWebPath($appName) . "/img/$file"; |
|
| 245 | - } elseif ($appPath && !file_exists($appPath . "/img/$basename.svg") |
|
| 246 | - && file_exists($appPath . "/img/$basename.png")) { |
|
| 247 | - $path = $this->getAppManager()->getAppWebPath($appName) . "/img/$basename.png"; |
|
| 248 | - } elseif (!empty($appName) and file_exists(\OC::$SERVERROOT . "/$appName/img/$file")) { |
|
| 249 | - $path = \OC::$WEBROOT . "/$appName/img/$file"; |
|
| 250 | - } elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT . "/$appName/img/$basename.svg") |
|
| 251 | - && file_exists(\OC::$SERVERROOT . "/$appName/img/$basename.png"))) { |
|
| 252 | - $path = \OC::$WEBROOT . "/$appName/img/$basename.png"; |
|
| 253 | - } elseif (file_exists(\OC::$SERVERROOT . "/core/img/$file")) { |
|
| 254 | - $path = \OC::$WEBROOT . "/core/img/$file"; |
|
| 255 | - } elseif (!file_exists(\OC::$SERVERROOT . "/core/img/$basename.svg") |
|
| 256 | - && file_exists(\OC::$SERVERROOT . "/core/img/$basename.png")) { |
|
| 257 | - $path = \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png"; |
|
| 243 | + } elseif ($appPath && file_exists($appPath."/img/$file")) { |
|
| 244 | + $path = $this->getAppManager()->getAppWebPath($appName)."/img/$file"; |
|
| 245 | + } elseif ($appPath && !file_exists($appPath."/img/$basename.svg") |
|
| 246 | + && file_exists($appPath."/img/$basename.png")) { |
|
| 247 | + $path = $this->getAppManager()->getAppWebPath($appName)."/img/$basename.png"; |
|
| 248 | + } elseif (!empty($appName) and file_exists(\OC::$SERVERROOT."/$appName/img/$file")) { |
|
| 249 | + $path = \OC::$WEBROOT."/$appName/img/$file"; |
|
| 250 | + } elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT."/$appName/img/$basename.svg") |
|
| 251 | + && file_exists(\OC::$SERVERROOT."/$appName/img/$basename.png"))) { |
|
| 252 | + $path = \OC::$WEBROOT."/$appName/img/$basename.png"; |
|
| 253 | + } elseif (file_exists(\OC::$SERVERROOT."/core/img/$file")) { |
|
| 254 | + $path = \OC::$WEBROOT."/core/img/$file"; |
|
| 255 | + } elseif (!file_exists(\OC::$SERVERROOT."/core/img/$basename.svg") |
|
| 256 | + && file_exists(\OC::$SERVERROOT."/core/img/$basename.png")) { |
|
| 257 | + $path = \OC::$WEBROOT."/themes/$theme/core/img/$basename.png"; |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if ($path !== '') { |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | return $path; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - throw new RuntimeException('image not found: image:' . $file . ' webroot:' . \OC::$WEBROOT . ' serverroot:' . \OC::$SERVERROOT); |
|
| 265 | + throw new RuntimeException('image not found: image:'.$file.' webroot:'.\OC::$WEBROOT.' serverroot:'.\OC::$SERVERROOT); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
@@ -275,14 +275,14 @@ discard block |
||
| 275 | 275 | $separator = str_starts_with($url, '/') ? '' : '/'; |
| 276 | 276 | |
| 277 | 277 | if (\OC::$CLI && !\defined('PHPUNIT_RUN')) { |
| 278 | - return rtrim($this->config->getSystemValueString('overwrite.cli.url'), '/') . '/' . ltrim($url, '/'); |
|
| 278 | + return rtrim($this->config->getSystemValueString('overwrite.cli.url'), '/').'/'.ltrim($url, '/'); |
|
| 279 | 279 | } |
| 280 | 280 | // The ownCloud web root can already be prepended. |
| 281 | 281 | if (\OC::$WEBROOT !== '' && str_starts_with($url, \OC::$WEBROOT)) { |
| 282 | 282 | $url = substr($url, \strlen(\OC::$WEBROOT)); |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - return $this->getBaseUrl() . $separator . $url; |
|
| 285 | + return $this->getBaseUrl().$separator.$url; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |
@@ -315,10 +315,10 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | if ($this->config->getSystemValueBool('htaccess.IgnoreFrontController', false) |
| 317 | 317 | || getenv('front_controller_active') === 'true') { |
| 318 | - return $this->getAbsoluteURL('/apps/' . $appId . '/'); |
|
| 318 | + return $this->getAbsoluteURL('/apps/'.$appId.'/'); |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | - return $this->getAbsoluteURL('/index.php/apps/' . $appId . '/'); |
|
| 321 | + return $this->getAbsoluteURL('/index.php/apps/'.$appId.'/'); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | public function getBaseUrl(): string { |
| 328 | 328 | // BaseUrl can be equal to 'http(s)://' during the first steps of the initial setup. |
| 329 | 329 | if ($this->baseUrl === null || $this->baseUrl === "http://" || $this->baseUrl === "https://") { |
| 330 | - $this->baseUrl = $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT; |
|
| 330 | + $this->baseUrl = $this->request->getServerProtocol().'://'.$this->request->getServerHost().\OC::$WEBROOT; |
|
| 331 | 331 | } |
| 332 | 332 | return $this->baseUrl; |
| 333 | 333 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | public static function buildAppNamespace(string $appId, string $topNamespace = 'OCA\\'): string { |
| 67 | 67 | // Hit the cache! |
| 68 | 68 | if (isset(self::$nameSpaceCache[$appId])) { |
| 69 | - return $topNamespace . self::$nameSpaceCache[$appId]; |
|
| 69 | + return $topNamespace.self::$nameSpaceCache[$appId]; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $appInfo = \OCP\Server::get(IAppManager::class)->getAppInfo($appId); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return $topNamespace . self::$nameSpaceCache[$appId]; |
|
| 91 | + return $topNamespace.self::$nameSpaceCache[$appId]; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | public static function getAppIdForClass(string $className, string $topNamespace = 'OCA\\'): ?string { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | foreach (self::$nameSpaceCache as $appId => $namespace) { |
| 100 | - if (str_starts_with($className, $topNamespace . $namespace . '\\')) { |
|
| 100 | + if (str_starts_with($className, $topNamespace.$namespace.'\\')) { |
|
| 101 | 101 | return $appId; |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | if (str_contains($controllerName, '\\Controller\\')) { |
| 152 | 152 | // This is from a global registered app route that is not enabled. |
| 153 | 153 | [/*OC(A)*/, $app, /* Controller/Name*/] = explode('\\', $controllerName, 3); |
| 154 | - throw new HintException('App ' . strtolower($app) . ' is not enabled'); |
|
| 154 | + throw new HintException('App '.strtolower($app).' is not enabled'); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if ($appName === 'core') { |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } else { |
| 160 | 160 | $appNameSpace = self::buildAppNamespace($appName); |
| 161 | 161 | } |
| 162 | - $controllerName = $appNameSpace . '\\Controller\\' . $controllerName; |
|
| 162 | + $controllerName = $appNameSpace.'\\Controller\\'.$controllerName; |
|
| 163 | 163 | $controller = $container->query($controllerName); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -191,8 +191,8 @@ discard block |
||
| 191 | 191 | $eventLogger->end('runtime'); |
| 192 | 192 | $profile = $profiler->collect($container->get(IRequest::class), $response); |
| 193 | 193 | $profiler->saveProfile($profile); |
| 194 | - $io->setHeader('X-Debug-Token:' . $profile->getToken()); |
|
| 195 | - $io->setHeader('Server-Timing: token;desc="' . $profile->getToken() . '"'); |
|
| 194 | + $io->setHeader('X-Debug-Token:'.$profile->getToken()); |
|
| 195 | + $io->setHeader('Server-Timing: token;desc="'.$profile->getToken().'"'); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (!is_null($httpHeaders)) { |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | foreach ($responseHeaders as $name => $value) { |
| 203 | - $io->setHeader($name . ': ' . $value); |
|
| 203 | + $io->setHeader($name.': '.$value); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | foreach ($responseCookies as $name => $value) { |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | $emptyResponse = false; |
| 232 | 232 | if (preg_match('/^HTTP\/\d\.\d (\d{3}) .*$/', $httpHeaders, $matches)) { |
| 233 | - $status = (int)$matches[1]; |
|
| 233 | + $status = (int) $matches[1]; |
|
| 234 | 234 | if ($status === Http::STATUS_NO_CONTENT || $status === Http::STATUS_NOT_MODIFIED) { |
| 235 | 235 | $emptyResponse = true; |
| 236 | 236 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | if ($response instanceof ICallbackResponse) { |
| 241 | 241 | $response->callback($io); |
| 242 | 242 | } elseif (!is_null($output)) { |
| 243 | - $io->setHeader('Content-Length: ' . strlen($output)); |
|
| 243 | + $io->setHeader('Content-Length: '.strlen($output)); |
|
| 244 | 244 | $io->setOutput($output); |
| 245 | 245 | } |
| 246 | 246 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | $dispatcher = $container['Dispatcher']; |
| 265 | 265 | |
| 266 | - [, , $output] = $dispatcher->dispatch($controller, $methodName); |
|
| 266 | + [,, $output] = $dispatcher->dispatch($controller, $methodName); |
|
| 267 | 267 | return $output; |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -299,8 +299,8 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function getHeader(string $name): string { |
| 301 | 301 | $name = strtoupper(str_replace('-', '_', $name)); |
| 302 | - if (isset($this->server['HTTP_' . $name])) { |
|
| 303 | - return $this->server['HTTP_' . $name]; |
|
| 302 | + if (isset($this->server['HTTP_'.$name])) { |
|
| 303 | + return $this->server['HTTP_'.$name]; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // There's a few headers that seem to end up in the top-level |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | * @return bool |
| 625 | 625 | */ |
| 626 | 626 | private function isOverwriteCondition(string $type = ''): bool { |
| 627 | - $regex = '/' . $this->config->getSystemValueString('overwritecondaddr', '') . '/'; |
|
| 627 | + $regex = '/'.$this->config->getSystemValueString('overwritecondaddr', '').'/'; |
|
| 628 | 628 | $remoteAddr = isset($this->server['REMOTE_ADDR']) ? $this->server['REMOTE_ADDR'] : ''; |
| 629 | 629 | return $regex === '//' || preg_match($regex, $remoteAddr) === 1 |
| 630 | 630 | || $type !== 'protocol'; |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | public function getRequestUri(): string { |
| 698 | 698 | $uri = isset($this->server['REQUEST_URI']) ? $this->server['REQUEST_URI'] : ''; |
| 699 | 699 | if ($this->config->getSystemValueString('overwritewebroot') !== '' && $this->isOverwriteCondition()) { |
| 700 | - $uri = $this->getScriptName() . substr($uri, \strlen($this->server['SCRIPT_NAME'])); |
|
| 700 | + $uri = $this->getScriptName().substr($uri, \strlen($this->server['SCRIPT_NAME'])); |
|
| 701 | 701 | } |
| 702 | 702 | return $uri; |
| 703 | 703 | } |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | // FIXME: Sabre does not really belong here |
| 725 | 725 | [$path, $name] = \Sabre\Uri\split($scriptName); |
| 726 | 726 | if (!empty($path)) { |
| 727 | - if ($path === $pathInfo || str_starts_with($pathInfo, $path . '/')) { |
|
| 727 | + if ($path === $pathInfo || str_starts_with($pathInfo, $path.'/')) { |
|
| 728 | 728 | $pathInfo = substr($pathInfo, \strlen($path)); |
| 729 | 729 | } else { |
| 730 | 730 | throw new \Exception("The requested uri($requestUri) cannot be processed by the script '$scriptName')"); |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | $name = ''; |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | - if (str_starts_with($pathInfo, '/' . $name)) { |
|
| 737 | + if (str_starts_with($pathInfo, '/'.$name)) { |
|
| 738 | 738 | $pathInfo = substr($pathInfo, \strlen($name) + 1); |
| 739 | 739 | } |
| 740 | 740 | if ($name !== '' && str_starts_with($pathInfo, $name)) { |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | // FIXME: This code is untestable due to __DIR__, also that hardcoded path is really dangerous |
| 770 | 770 | $serverRoot = str_replace('\\', '/', substr(__DIR__, 0, -\strlen('lib/private/appframework/http/'))); |
| 771 | 771 | $suburi = str_replace('\\', '/', substr(realpath($this->server['SCRIPT_FILENAME']), \strlen($serverRoot))); |
| 772 | - $name = '/' . ltrim($overwriteWebRoot . $suburi, '/'); |
|
| 772 | + $name = '/'.ltrim($overwriteWebRoot.$suburi, '/'); |
|
| 773 | 773 | } |
| 774 | 774 | return $name; |
| 775 | 775 | } |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | return $host; |
| 845 | 845 | } |
| 846 | 846 | |
| 847 | - $trustedList = (array)$this->config->getSystemValue('trusted_domains', []); |
|
| 847 | + $trustedList = (array) $this->config->getSystemValue('trusted_domains', []); |
|
| 848 | 848 | if (count($trustedList) > 0) { |
| 849 | 849 | return reset($trustedList); |
| 850 | 850 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | private static function getBoundary(): string { |
| 65 | 65 | if (empty(self::$multipartBoundary)) { |
| 66 | - self::$multipartBoundary = md5((string)mt_rand()); |
|
| 66 | + self::$multipartBoundary = md5((string) mt_rand()); |
|
| 67 | 67 | } |
| 68 | 68 | return self::$multipartBoundary; |
| 69 | 69 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | private static function sendHeaders($filename, $name, array $rangeArray): void { |
| 77 | 77 | OC_Response::setContentDispositionHeader($name, 'attachment'); |
| 78 | 78 | header('Content-Transfer-Encoding: binary', true); |
| 79 | - header('Pragma: public');// enable caching in IE |
|
| 79 | + header('Pragma: public'); // enable caching in IE |
|
| 80 | 80 | header('Expires: 0'); |
| 81 | 81 | header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); |
| 82 | 82 | $fileSize = \OC\Files\Filesystem::filesize($filename); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | if (!is_array($files)) { |
| 121 | - $filename = $dir . '/' . $files; |
|
| 121 | + $filename = $dir.'/'.$files; |
|
| 122 | 122 | if (!$view->is_dir($filename)) { |
| 123 | 123 | self::getSingleFile($view, $dir, $files, is_null($params) ? [] : $params); |
| 124 | 124 | return; |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | $name = $basename; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $filename = $dir . '/' . $name; |
|
| 136 | + $filename = $dir.'/'.$name; |
|
| 137 | 137 | } else { |
| 138 | - $filename = $dir . '/' . $files; |
|
| 138 | + $filename = $dir.'/'.$files; |
|
| 139 | 139 | $getType = self::ZIP_DIR; |
| 140 | 140 | // downloading root ? |
| 141 | 141 | if ($files !== '') { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | if ($getType === self::ZIP_FILES) { |
| 152 | 152 | $fileInfos = []; |
| 153 | 153 | foreach ($files as $file) { |
| 154 | - $fileInfo = \OC\Files\Filesystem::getFileInfo($dir . '/' . $file); |
|
| 154 | + $fileInfo = \OC\Files\Filesystem::getFileInfo($dir.'/'.$file); |
|
| 155 | 155 | if ($fileInfo) { |
| 156 | 156 | $fileSize += $fileInfo->getSize(); |
| 157 | 157 | $fileInfos[] = $fileInfo; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | $numberOfFiles = self::getNumberOfFiles($fileInfos); |
| 161 | 161 | } elseif ($getType === self::ZIP_DIR) { |
| 162 | - $fileInfo = \OC\Files\Filesystem::getFileInfo($dir . '/' . $files); |
|
| 162 | + $fileInfo = \OC\Files\Filesystem::getFileInfo($dir.'/'.$files); |
|
| 163 | 163 | if ($fileInfo) { |
| 164 | 164 | $fileSize = $fileInfo->getSize(); |
| 165 | 165 | $numberOfFiles = self::getNumberOfFiles([$fileInfo]); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | OC_Util::obEnd(); |
| 179 | 179 | |
| 180 | 180 | $streamer->sendHeaders($name); |
| 181 | - $executionTime = (int)OC::$server->get(IniGetWrapper::class)->getNumeric('max_execution_time'); |
|
| 181 | + $executionTime = (int) OC::$server->get(IniGetWrapper::class)->getNumeric('max_execution_time'); |
|
| 182 | 182 | if (!str_contains(@ini_get('disable_functions'), 'set_time_limit')) { |
| 183 | 183 | @set_time_limit(0); |
| 184 | 184 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | if ($getType === self::ZIP_FILES) { |
| 188 | 188 | foreach ($files as $file) { |
| 189 | - $file = $dir . '/' . $file; |
|
| 189 | + $file = $dir.'/'.$file; |
|
| 190 | 190 | if (\OC\Files\Filesystem::is_file($file)) { |
| 191 | 191 | $userFolder = \OC::$server->getRootFolder()->get(\OC\Files\Filesystem::getRoot()); |
| 192 | 192 | $file = $userFolder->get($file); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | // File is not a file? … |
| 203 | 203 | \OC::$server->getLogger()->debug( |
| 204 | 204 | 'File given, but no Node available. Name {file}', |
| 205 | - [ 'app' => 'files', 'file' => $file ] |
|
| 205 | + ['app' => 'files', 'file' => $file] |
|
| 206 | 206 | ); |
| 207 | 207 | continue; |
| 208 | 208 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | } elseif ($getType === self::ZIP_DIR) { |
| 216 | - $file = $dir . '/' . $files; |
|
| 216 | + $file = $dir.'/'.$files; |
|
| 217 | 217 | $streamer->addDirRecursive($file); |
| 218 | 218 | } |
| 219 | 219 | $streamer->finalize(); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $l = \OC::$server->getL10N('lib'); |
| 237 | 237 | $hint = method_exists($ex, 'getHint') ? $ex->getHint() : ''; |
| 238 | 238 | if ($event && $event->getErrorMessage() !== null) { |
| 239 | - $hint .= ' ' . $event->getErrorMessage(); |
|
| 239 | + $hint .= ' '.$event->getErrorMessage(); |
|
| 240 | 240 | } |
| 241 | 241 | \OC_Template::printErrorPage($l->t('Cannot download file'), $hint, 200); |
| 242 | 242 | } |
@@ -271,21 +271,21 @@ discard block |
||
| 271 | 271 | if ($ranges[1] >= $fileSize) { |
| 272 | 272 | $ranges[1] = $fileSize - 1; |
| 273 | 273 | } |
| 274 | - $rangeArray[$ind++] = [ 'from' => $ranges[0], 'to' => $ranges[1], 'size' => $fileSize ]; |
|
| 274 | + $rangeArray[$ind++] = ['from' => $ranges[0], 'to' => $ranges[1], 'size' => $fileSize]; |
|
| 275 | 275 | $minOffset = $ranges[1] + 1; |
| 276 | 276 | if ($minOffset >= $fileSize) { |
| 277 | 277 | break; |
| 278 | 278 | } |
| 279 | 279 | } elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) { |
| 280 | 280 | // case: x- |
| 281 | - $rangeArray[$ind++] = [ 'from' => $ranges[0], 'to' => $fileSize - 1, 'size' => $fileSize ]; |
|
| 281 | + $rangeArray[$ind++] = ['from' => $ranges[0], 'to' => $fileSize - 1, 'size' => $fileSize]; |
|
| 282 | 282 | break; |
| 283 | 283 | } elseif (is_numeric($ranges[1])) { |
| 284 | 284 | // case: -x |
| 285 | 285 | if ($ranges[1] > $fileSize) { |
| 286 | 286 | $ranges[1] = $fileSize; |
| 287 | 287 | } |
| 288 | - $rangeArray[$ind++] = [ 'from' => $fileSize - $ranges[1], 'to' => $fileSize - 1, 'size' => $fileSize ]; |
|
| 288 | + $rangeArray[$ind++] = ['from' => $fileSize - $ranges[1], 'to' => $fileSize - 1, 'size' => $fileSize]; |
|
| 289 | 289 | break; |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | * @throws \OC\ForbiddenException |
| 301 | 301 | */ |
| 302 | 302 | private static function getSingleFile($view, $dir, $name, $params) { |
| 303 | - $filename = $dir . '/' . $name; |
|
| 303 | + $filename = $dir.'/'.$name; |
|
| 304 | 304 | $file = null; |
| 305 | 305 | |
| 306 | 306 | try { |
@@ -414,17 +414,17 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | public static function lockFiles($view, $dir, $files) { |
| 416 | 416 | if (!is_array($files)) { |
| 417 | - $file = $dir . '/' . $files; |
|
| 417 | + $file = $dir.'/'.$files; |
|
| 418 | 418 | $files = [$file]; |
| 419 | 419 | } |
| 420 | 420 | foreach ($files as $file) { |
| 421 | - $file = $dir . '/' . $file; |
|
| 421 | + $file = $dir.'/'.$file; |
|
| 422 | 422 | $view->lockFile($file, ILockingProvider::LOCK_SHARED); |
| 423 | 423 | if ($view->is_dir($file)) { |
| 424 | 424 | $contents = $view->getDirectoryContent($file); |
| 425 | - $contents = array_map(function ($fileInfo) use ($file) { |
|
| 425 | + $contents = array_map(function($fileInfo) use ($file) { |
|
| 426 | 426 | /** @var \OCP\Files\FileInfo $fileInfo */ |
| 427 | - return $file . '/' . $fileInfo->getName(); |
|
| 427 | + return $file.'/'.$fileInfo->getName(); |
|
| 428 | 428 | }, $contents); |
| 429 | 429 | self::lockFiles($view, $dir, $contents); |
| 430 | 430 | } |
@@ -444,12 +444,12 @@ discard block |
||
| 444 | 444 | } |
| 445 | 445 | if ($getType === self::ZIP_FILES) { |
| 446 | 446 | foreach ($files as $file) { |
| 447 | - $file = $dir . '/' . $file; |
|
| 447 | + $file = $dir.'/'.$file; |
|
| 448 | 448 | $view->unlockFile($file, ILockingProvider::LOCK_SHARED); |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | if ($getType === self::ZIP_DIR) { |
| 452 | - $file = $dir . '/' . $files; |
|
| 452 | + $file = $dir.'/'.$files; |
|
| 453 | 453 | $view->unlockFile($file, ILockingProvider::LOCK_SHARED); |
| 454 | 454 | } |
| 455 | 455 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | /** @var LoggerInterface $logger */ |
| 185 | 185 | $logger = \OC::$server->get(LoggerInterface::class); |
| 186 | 186 | |
| 187 | - $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValueString('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); |
|
| 187 | + $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValueString('skeletondirectory', \OC::$SERVERROOT.'/core/skeleton'); |
|
| 188 | 188 | $userLang = \OC::$server->getL10NFactory()->findLanguage(); |
| 189 | 189 | $skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory); |
| 190 | 190 | |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | if ($instanceId === null) { |
| 207 | 207 | throw new \RuntimeException('no instance id!'); |
| 208 | 208 | } |
| 209 | - $appdata = 'appdata_' . $instanceId; |
|
| 209 | + $appdata = 'appdata_'.$instanceId; |
|
| 210 | 210 | if ($userId === $appdata) { |
| 211 | - throw new \RuntimeException('username is reserved name: ' . $appdata); |
|
| 211 | + throw new \RuntimeException('username is reserved name: '.$appdata); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | if (!empty($skeletonDirectory)) { |
@@ -243,14 +243,14 @@ discard block |
||
| 243 | 243 | // Copy the files |
| 244 | 244 | while (false !== ($file = readdir($dir))) { |
| 245 | 245 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
| 246 | - if (is_dir($source . '/' . $file)) { |
|
| 246 | + if (is_dir($source.'/'.$file)) { |
|
| 247 | 247 | $child = $target->newFolder($file); |
| 248 | - self::copyr($source . '/' . $file, $child); |
|
| 248 | + self::copyr($source.'/'.$file, $child); |
|
| 249 | 249 | } else { |
| 250 | 250 | $child = $target->newFile($file); |
| 251 | - $sourceStream = fopen($source . '/' . $file, 'r'); |
|
| 251 | + $sourceStream = fopen($source.'/'.$file, 'r'); |
|
| 252 | 252 | if ($sourceStream === false) { |
| 253 | - $logger->error(sprintf('Could not fopen "%s"', $source . '/' . $file), ['app' => 'core']); |
|
| 253 | + $logger->error(sprintf('Could not fopen "%s"', $source.'/'.$file), ['app' => 'core']); |
|
| 254 | 254 | closedir($dir); |
| 255 | 255 | return; |
| 256 | 256 | } |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | return; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - require OC::$SERVERROOT . '/version.php'; |
|
| 329 | + require OC::$SERVERROOT.'/version.php'; |
|
| 330 | 330 | /** @var int $timestamp */ |
| 331 | 331 | self::$versionCache['OC_Version_Timestamp'] = \OC::$VERSION_MTIME; |
| 332 | 332 | /** @var string $OC_Version */ |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | public static function checkServer(\OC\SystemConfig $config) { |
| 501 | 501 | $l = \OC::$server->getL10N('lib'); |
| 502 | 502 | $errors = []; |
| 503 | - $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data'); |
|
| 503 | + $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT.'/data'); |
|
| 504 | 504 | |
| 505 | 505 | if (!self::needUpgrade($config) && $config->getValue('installed', false)) { |
| 506 | 506 | // this check needs to be done every time |
@@ -540,9 +540,9 @@ discard block |
||
| 540 | 540 | $errors[] = [ |
| 541 | 541 | 'error' => $l->t('Cannot write into "config" directory.'), |
| 542 | 542 | 'hint' => $l->t('This can usually be fixed by giving the web server write access to the config directory. See %s', |
| 543 | - [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' |
|
| 543 | + [$urlGenerator->linkToDocs('admin-dir_permissions')]).'. ' |
|
| 544 | 544 | . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', |
| 545 | - [ $urlGenerator->linkToDocs('admin-config') ]) |
|
| 545 | + [$urlGenerator->linkToDocs('admin-config')]) |
|
| 546 | 546 | ]; |
| 547 | 547 | } |
| 548 | 548 | } |
@@ -803,10 +803,10 @@ discard block |
||
| 803 | 803 | 'hint' => $l->t('Check the value of "datadirectory" in your configuration.') |
| 804 | 804 | ]; |
| 805 | 805 | } |
| 806 | - if (!file_exists($dataDirectory . '/.ocdata')) { |
|
| 806 | + if (!file_exists($dataDirectory.'/.ocdata')) { |
|
| 807 | 807 | $errors[] = [ |
| 808 | 808 | 'error' => $l->t('Your data directory is invalid.'), |
| 809 | - 'hint' => $l->t('Ensure there is a file called ".ocdata"' . |
|
| 809 | + 'hint' => $l->t('Ensure there is a file called ".ocdata"'. |
|
| 810 | 810 | ' in the root of the data directory.') |
| 811 | 811 | ]; |
| 812 | 812 | } |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | public static function checkLoggedIn() { |
| 823 | 823 | // Check if we are a user |
| 824 | 824 | if (!\OC::$server->getUserSession()->isLoggedIn()) { |
| 825 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute( |
|
| 825 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute( |
|
| 826 | 826 | 'core.login.showLoginForm', |
| 827 | 827 | [ |
| 828 | 828 | 'redirect_url' => \OC::$server->getRequest()->getRequestUri(), |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | } |
| 834 | 834 | // Redirect to 2FA challenge selection if 2FA challenge was not solved yet |
| 835 | 835 | if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
| 836 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
| 836 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
| 837 | 837 | exit(); |
| 838 | 838 | } |
| 839 | 839 | } |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | public static function checkAdminUser() { |
| 847 | 847 | OC_Util::checkLoggedIn(); |
| 848 | 848 | if (!OC_User::isAdminUser(OC_User::getUser())) { |
| 849 | - header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php')); |
|
| 849 | + header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php')); |
|
| 850 | 850 | exit(); |
| 851 | 851 | } |
| 852 | 852 | } |
@@ -872,7 +872,7 @@ discard block |
||
| 872 | 872 | */ |
| 873 | 873 | public static function redirectToDefaultPage() { |
| 874 | 874 | $location = self::getDefaultPageUrl(); |
| 875 | - header('Location: ' . $location); |
|
| 875 | + header('Location: '.$location); |
|
| 876 | 876 | exit(); |
| 877 | 877 | } |
| 878 | 878 | |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | $id = \OC::$server->getSystemConfig()->getValue('instanceid', null); |
| 886 | 886 | if (is_null($id)) { |
| 887 | 887 | // We need to guarantee at least one letter in instanceid so it can be used as the session_name |
| 888 | - $id = 'oc' . \OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
| 888 | + $id = 'oc'.\OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
| 889 | 889 | \OC::$server->getSystemConfig()->setValue('instanceid', $id); |
| 890 | 890 | } |
| 891 | 891 | return $id; |
@@ -903,12 +903,12 @@ discard block |
||
| 903 | 903 | public static function sanitizeHTML($value) { |
| 904 | 904 | if (is_array($value)) { |
| 905 | 905 | /** @var string[] $value */ |
| 906 | - $value = array_map(function ($value) { |
|
| 906 | + $value = array_map(function($value) { |
|
| 907 | 907 | return self::sanitizeHTML($value); |
| 908 | 908 | }, $value); |
| 909 | 909 | } else { |
| 910 | 910 | // Specify encoding for PHP<5.4 |
| 911 | - $value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); |
|
| 911 | + $value = htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8'); |
|
| 912 | 912 | } |
| 913 | 913 | return $value; |
| 914 | 914 | } |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | $testContent = 'This is used for testing whether htaccess is properly enabled to disallow access from the outside. This file can be safely removed.'; |
| 942 | 942 | |
| 943 | 943 | // creating a test file |
| 944 | - $testFile = $config->getSystemValueString('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
| 944 | + $testFile = $config->getSystemValueString('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
| 945 | 945 | |
| 946 | 946 | if (file_exists($testFile)) {// already running this test, possible recursive call |
| 947 | 947 | return false; |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | $fp = @fopen($testFile, 'w'); |
| 951 | 951 | if (!$fp) { |
| 952 | 952 | throw new \OCP\HintException('Can\'t create test file to check for working .htaccess file.', |
| 953 | - 'Make sure it is possible for the web server to write to ' . $testFile); |
|
| 953 | + 'Make sure it is possible for the web server to write to '.$testFile); |
|
| 954 | 954 | } |
| 955 | 955 | fwrite($fp, $testContent); |
| 956 | 956 | fclose($fp); |
@@ -977,10 +977,10 @@ discard block |
||
| 977 | 977 | } |
| 978 | 978 | |
| 979 | 979 | $fileName = '/htaccesstest.txt'; |
| 980 | - $testFile = $config->getSystemValueString('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
| 980 | + $testFile = $config->getSystemValueString('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
| 981 | 981 | |
| 982 | 982 | // accessing the file via http |
| 983 | - $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName); |
|
| 983 | + $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT.'/data'.$fileName); |
|
| 984 | 984 | try { |
| 985 | 985 | $content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody(); |
| 986 | 986 | } catch (\Exception $e) { |
@@ -988,9 +988,9 @@ discard block |
||
| 988 | 988 | } |
| 989 | 989 | |
| 990 | 990 | if (str_starts_with($url, 'https:')) { |
| 991 | - $url = 'http:' . substr($url, 6); |
|
| 991 | + $url = 'http:'.substr($url, 6); |
|
| 992 | 992 | } else { |
| 993 | - $url = 'https:' . substr($url, 5); |
|
| 993 | + $url = 'https:'.substr($url, 5); |
|
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | try { |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | $theme = \OC::$server->getSystemConfig()->getValue("theme", ''); |
| 1097 | 1097 | |
| 1098 | 1098 | if ($theme === '') { |
| 1099 | - if (is_dir(OC::$SERVERROOT . '/themes/default')) { |
|
| 1099 | + if (is_dir(OC::$SERVERROOT.'/themes/default')) { |
|
| 1100 | 1100 | $theme = 'default'; |
| 1101 | 1101 | } |
| 1102 | 1102 | } |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | |
| 1118 | 1118 | $normalizedValue = Normalizer::normalize($value); |
| 1119 | 1119 | if ($normalizedValue === null || $normalizedValue === false) { |
| 1120 | - \OC::$server->getLogger()->warning('normalizing failed for "' . $value . '"', ['app' => 'core']); |
|
| 1120 | + \OC::$server->getLogger()->warning('normalizing failed for "'.$value.'"', ['app' => 'core']); |
|
| 1121 | 1121 | return $value; |
| 1122 | 1122 | } |
| 1123 | 1123 | |
@@ -1133,7 +1133,7 @@ discard block |
||
| 1133 | 1133 | $version = OC_Util::getVersionString(); |
| 1134 | 1134 | $build = OC_Util::getBuild(); |
| 1135 | 1135 | if (!empty($build) and OC_Util::getChannel() === 'daily') { |
| 1136 | - $version .= ' Build:' . $build; |
|
| 1136 | + $version .= ' Build:'.$build; |
|
| 1137 | 1137 | } |
| 1138 | 1138 | return $version; |
| 1139 | 1139 | } |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | // detect part files |
| 1158 | - if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) { |
|
| 1158 | + if (preg_match('/'.\OCP\Files\FileInfo::BLACKLIST_FILES_REGEX.'/', $trimmed) !== 0) { |
|
| 1159 | 1159 | return false; |
| 1160 | 1160 | } |
| 1161 | 1161 | |
@@ -1186,19 +1186,19 @@ discard block |
||
| 1186 | 1186 | } elseif ($config->getValue('debug', false) && $versionDiff < 0) { |
| 1187 | 1187 | // downgrade with debug |
| 1188 | 1188 | $installedMajor = explode('.', $installedVersion); |
| 1189 | - $installedMajor = $installedMajor[0] . '.' . $installedMajor[1]; |
|
| 1189 | + $installedMajor = $installedMajor[0].'.'.$installedMajor[1]; |
|
| 1190 | 1190 | $currentMajor = explode('.', $currentVersion); |
| 1191 | - $currentMajor = $currentMajor[0] . '.' . $currentMajor[1]; |
|
| 1191 | + $currentMajor = $currentMajor[0].'.'.$currentMajor[1]; |
|
| 1192 | 1192 | if ($installedMajor === $currentMajor) { |
| 1193 | 1193 | // Same major, allow downgrade for developers |
| 1194 | 1194 | return true; |
| 1195 | 1195 | } else { |
| 1196 | 1196 | // downgrade attempt, throw exception |
| 1197 | - throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
| 1197 | + throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
| 1198 | 1198 | } |
| 1199 | 1199 | } elseif ($versionDiff < 0) { |
| 1200 | 1200 | // downgrade attempt, throw exception |
| 1201 | - throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
| 1201 | + throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
| 1202 | 1202 | } |
| 1203 | 1203 | |
| 1204 | 1204 | // also check for upgrades for apps (independently from the user) |