@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | \OC_App::setupBackgroundJobs($info['background-jobs']); |
| 170 | 170 | |
| 171 | 171 | //run appinfo/install.php |
| 172 | - self::includeAppScript($basedir . '/appinfo/install.php'); |
|
| 172 | + self::includeAppScript($basedir.'/appinfo/install.php'); |
|
| 173 | 173 | |
| 174 | 174 | $appData = OC_App::getAppInfo($appId); |
| 175 | 175 | OC_App::executeRepairSteps($appId, $appData['repair-steps']['install']); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | if ($app['id'] === $appId) { |
| 244 | 244 | // Load the certificate |
| 245 | 245 | $certificate = new X509(); |
| 246 | - $rootCrt = file_get_contents(__DIR__ . '/../../resources/codesigning/root.crt'); |
|
| 246 | + $rootCrt = file_get_contents(__DIR__.'/../../resources/codesigning/root.crt'); |
|
| 247 | 247 | $rootCrts = $this->splitCerts($rootCrt); |
| 248 | 248 | foreach ($rootCrts as $rootCrt) { |
| 249 | 249 | $certificate->loadCA($rootCrt); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | foreach ($rootCrts as $rootCrt) { |
| 256 | 256 | $crl->loadCA($rootCrt); |
| 257 | 257 | } |
| 258 | - $crl->loadCRL(file_get_contents(__DIR__ . '/../../resources/codesigning/root.crl')); |
|
| 258 | + $crl->loadCRL(file_get_contents(__DIR__.'/../../resources/codesigning/root.crl')); |
|
| 259 | 259 | if ($crl->validateSignature() !== true) { |
| 260 | 260 | throw new \Exception('Could not validate CRL signature'); |
| 261 | 261 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | // Check if the signature actually matches the downloaded content |
| 310 | 310 | $certificate = openssl_get_publickey($app['certificate']); |
| 311 | - $verified = (bool)openssl_verify(file_get_contents($tempFile), base64_decode($app['releases'][0]['signature']), $certificate, OPENSSL_ALGO_SHA512); |
|
| 311 | + $verified = (bool) openssl_verify(file_get_contents($tempFile), base64_decode($app['releases'][0]['signature']), $certificate, OPENSSL_ALGO_SHA512); |
|
| 312 | 312 | openssl_free_key($certificate); |
| 313 | 313 | |
| 314 | 314 | if ($verified === true) { |
@@ -318,11 +318,11 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | if ($archive) { |
| 320 | 320 | if (!$archive->extract($extractDir)) { |
| 321 | - $errorMessage = 'Could not extract app ' . $appId; |
|
| 321 | + $errorMessage = 'Could not extract app '.$appId; |
|
| 322 | 322 | |
| 323 | 323 | $archiveError = $archive->getError(); |
| 324 | 324 | if ($archiveError instanceof \PEAR_Error) { |
| 325 | - $errorMessage .= ': ' . $archiveError->getMessage(); |
|
| 325 | + $errorMessage .= ': '.$archiveError->getMessage(); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | throw new \Exception($errorMessage); |
@@ -342,21 +342,21 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | // Check if appinfo/info.xml has the same app ID as well |
| 344 | 344 | $loadEntities = libxml_disable_entity_loader(false); |
| 345 | - $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml'); |
|
| 345 | + $xml = simplexml_load_file($extractDir.'/'.$folders[0].'/appinfo/info.xml'); |
|
| 346 | 346 | libxml_disable_entity_loader($loadEntities); |
| 347 | - if ((string)$xml->id !== $appId) { |
|
| 347 | + if ((string) $xml->id !== $appId) { |
|
| 348 | 348 | throw new \Exception( |
| 349 | 349 | sprintf( |
| 350 | 350 | 'App for id %s has a wrong app ID in info.xml: %s', |
| 351 | 351 | $appId, |
| 352 | - (string)$xml->id |
|
| 352 | + (string) $xml->id |
|
| 353 | 353 | ) |
| 354 | 354 | ); |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | // Check if the version is lower than before |
| 358 | 358 | $currentVersion = OC_App::getAppVersion($appId); |
| 359 | - $newVersion = (string)$xml->version; |
|
| 359 | + $newVersion = (string) $xml->version; |
|
| 360 | 360 | if (version_compare($currentVersion, $newVersion) === 1) { |
| 361 | 361 | throw new \Exception( |
| 362 | 362 | sprintf( |
@@ -368,12 +368,12 @@ discard block |
||
| 368 | 368 | ); |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | - $baseDir = OC_App::getInstallPath() . '/' . $appId; |
|
| 371 | + $baseDir = OC_App::getInstallPath().'/'.$appId; |
|
| 372 | 372 | // Remove old app with the ID if existent |
| 373 | 373 | OC_Helper::rmdirr($baseDir); |
| 374 | 374 | // Move to app folder |
| 375 | 375 | if (@mkdir($baseDir)) { |
| 376 | - $extractDir .= '/' . $folders[0]; |
|
| 376 | + $extractDir .= '/'.$folders[0]; |
|
| 377 | 377 | OC_Helper::copyr($extractDir, $baseDir); |
| 378 | 378 | } |
| 379 | 379 | OC_Helper::copyr($extractDir, $baseDir); |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | if (\OC::$server->getAppManager()->isShipped($appId)) { |
| 513 | 513 | return false; |
| 514 | 514 | } |
| 515 | - $appDir = OC_App::getInstallPath() . '/' . $appId; |
|
| 515 | + $appDir = OC_App::getInstallPath().'/'.$appId; |
|
| 516 | 516 | OC_Helper::rmdirr($appDir); |
| 517 | 517 | return true; |
| 518 | 518 | } else { |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | OC_DB::createDbFromStructure("$appPath/appinfo/database.xml"); |
| 607 | 607 | } catch (TableExistsException $e) { |
| 608 | 608 | throw new HintException( |
| 609 | - 'Failed to enable app ' . $app, |
|
| 609 | + 'Failed to enable app '.$app, |
|
| 610 | 610 | 'Please ask for help via one of our <a href="https://nextcloud.com/support/" target="_blank" rel="noreferrer noopener">support channels</a>.', |
| 611 | 611 | 0, $e |
| 612 | 612 | ); |