Passed
Push — master ( 8f3a07...e1a300 )
by Lukas
13:39 queued 11s
created
lib/private/Installer.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 
116 116
 		$basedir = $app['path'].'/'.$appId;
117 117
 
118
-		if (is_file($basedir . '/appinfo/database.xml')) {
119
-			throw new \Exception('The appinfo/database.xml file is not longer supported. Used in ' . $appId);
118
+		if (is_file($basedir.'/appinfo/database.xml')) {
119
+			throw new \Exception('The appinfo/database.xml file is not longer supported. Used in '.$appId);
120 120
 		}
121 121
 
122 122
 		$info = OC_App::getAppInfo($basedir.'/appinfo/info.xml', true);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		\OC_App::setupBackgroundJobs($info['background-jobs']);
168 168
 
169 169
 		//run appinfo/install.php
170
-		self::includeAppScript($basedir . '/appinfo/install.php');
170
+		self::includeAppScript($basedir.'/appinfo/install.php');
171 171
 
172 172
 		$appData = OC_App::getAppInfo($appId);
173 173
 		OC_App::executeRepairSteps($appId, $appData['repair-steps']['install']);
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			if ($app['id'] === $appId) {
242 242
 				// Load the certificate
243 243
 				$certificate = new X509();
244
-				$rootCrt = file_get_contents(__DIR__ . '/../../resources/codesigning/root.crt');
244
+				$rootCrt = file_get_contents(__DIR__.'/../../resources/codesigning/root.crt');
245 245
 				$rootCrts = $this->splitCerts($rootCrt);
246 246
 				foreach ($rootCrts as $rootCrt) {
247 247
 					$certificate->loadCA($rootCrt);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 				foreach ($rootCrts as $rootCrt) {
254 254
 					$crl->loadCA($rootCrt);
255 255
 				}
256
-				$crl->loadCRL(file_get_contents(__DIR__ . '/../../resources/codesigning/root.crl'));
256
+				$crl->loadCRL(file_get_contents(__DIR__.'/../../resources/codesigning/root.crl'));
257 257
 				if ($crl->validateSignature() !== true) {
258 258
 					throw new \Exception('Could not validate CRL signature');
259 259
 				}
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
 				// Check if the signature actually matches the downloaded content
308 308
 				$certificate = openssl_get_publickey($app['certificate']);
309
-				$verified = (bool)openssl_verify(file_get_contents($tempFile), base64_decode($app['releases'][0]['signature']), $certificate, OPENSSL_ALGO_SHA512);
309
+				$verified = (bool) openssl_verify(file_get_contents($tempFile), base64_decode($app['releases'][0]['signature']), $certificate, OPENSSL_ALGO_SHA512);
310 310
 				// PHP 8+ deprecates openssl_free_key and automatically destroys the key instance when it goes out of scope
311 311
 				if ((PHP_VERSION_ID < 80000)) {
312 312
 					openssl_free_key($certificate);
@@ -319,11 +319,11 @@  discard block
 block discarded – undo
319 319
 
320 320
 					if ($archive) {
321 321
 						if (!$archive->extract($extractDir)) {
322
-							$errorMessage = 'Could not extract app ' . $appId;
322
+							$errorMessage = 'Could not extract app '.$appId;
323 323
 
324 324
 							$archiveError = $archive->getError();
325 325
 							if ($archiveError instanceof \PEAR_Error) {
326
-								$errorMessage .= ': ' . $archiveError->getMessage();
326
+								$errorMessage .= ': '.$archiveError->getMessage();
327 327
 							}
328 328
 
329 329
 							throw new \Exception($errorMessage);
@@ -344,24 +344,24 @@  discard block
 block discarded – undo
344 344
 						// Check if appinfo/info.xml has the same app ID as well
345 345
 						if ((PHP_VERSION_ID < 80000)) {
346 346
 							$loadEntities = libxml_disable_entity_loader(false);
347
-							$xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml');
347
+							$xml = simplexml_load_file($extractDir.'/'.$folders[0].'/appinfo/info.xml');
348 348
 							libxml_disable_entity_loader($loadEntities);
349 349
 						} else {
350
-							$xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml');
350
+							$xml = simplexml_load_file($extractDir.'/'.$folders[0].'/appinfo/info.xml');
351 351
 						}
352
-						if ((string)$xml->id !== $appId) {
352
+						if ((string) $xml->id !== $appId) {
353 353
 							throw new \Exception(
354 354
 								sprintf(
355 355
 									'App for id %s has a wrong app ID in info.xml: %s',
356 356
 									$appId,
357
-									(string)$xml->id
357
+									(string) $xml->id
358 358
 								)
359 359
 							);
360 360
 						}
361 361
 
362 362
 						// Check if the version is lower than before
363 363
 						$currentVersion = OC_App::getAppVersion($appId);
364
-						$newVersion = (string)$xml->version;
364
+						$newVersion = (string) $xml->version;
365 365
 						if (version_compare($currentVersion, $newVersion) === 1) {
366 366
 							throw new \Exception(
367 367
 								sprintf(
@@ -373,12 +373,12 @@  discard block
 block discarded – undo
373 373
 							);
374 374
 						}
375 375
 
376
-						$baseDir = OC_App::getInstallPath() . '/' . $appId;
376
+						$baseDir = OC_App::getInstallPath().'/'.$appId;
377 377
 						// Remove old app with the ID if existent
378 378
 						OC_Helper::rmdirr($baseDir);
379 379
 						// Move to app folder
380 380
 						if (@mkdir($baseDir)) {
381
-							$extractDir .= '/' . $folders[0];
381
+							$extractDir .= '/'.$folders[0];
382 382
 							OC_Helper::copyr($extractDir, $baseDir);
383 383
 						}
384 384
 						OC_Helper::copyr($extractDir, $baseDir);
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 			if (\OC::$server->getAppManager()->isShipped($appId)) {
518 518
 				return false;
519 519
 			}
520
-			$appDir = OC_App::getInstallPath() . '/' . $appId;
520
+			$appDir = OC_App::getInstallPath().'/'.$appId;
521 521
 			OC_Helper::rmdirr($appDir);
522 522
 			return true;
523 523
 		} else {
Please login to merge, or discard this patch.