Passed
Push — master ( c1eff7...9d1219 )
by Joas
12:44 queued 12s
created
lib/private/legacy/util.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
 	private static function initLocalStorageRootFS() {
85 85
 		// mount local file backend as root
86
-		$configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT . "/data");
86
+		$configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT."/data");
87 87
 		//first set up the local "root" storage
88 88
 		\OC\Files\Filesystem::initMountManager();
89 89
 		if (!self::$rootMounted) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		\OC\Files\Filesystem::initMountManager();
206 206
 
207 207
 		$prevLogging = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
208
-		\OC\Files\Filesystem::addStorageWrapper('mount_options', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
208
+		\OC\Files\Filesystem::addStorageWrapper('mount_options', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
209 209
 			if ($storage->instanceOfStorage('\OC\Files\Storage\Common')) {
210 210
 				/** @var \OC\Files\Storage\Common $storage */
211 211
 				$storage->setMountOptions($mount->getOptions());
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 			return $storage;
214 214
 		});
215 215
 
216
-		\OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
216
+		\OC\Files\Filesystem::addStorageWrapper('enable_sharing', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
217 217
 			if (!$mount->getOption('enable_sharing', true)) {
218 218
 				return new \OC\Files\Storage\Wrapper\PermissionsMask([
219 219
 					'storage' => $storage,
@@ -224,21 +224,21 @@  discard block
 block discarded – undo
224 224
 		});
225 225
 
226 226
 		// install storage availability wrapper, before most other wrappers
227
-		\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, \OCP\Files\Storage\IStorage $storage) {
227
+		\OC\Files\Filesystem::addStorageWrapper('oc_availability', function($mountPoint, \OCP\Files\Storage\IStorage $storage) {
228 228
 			if (!$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) {
229 229
 				return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]);
230 230
 			}
231 231
 			return $storage;
232 232
 		});
233 233
 
234
-		\OC\Files\Filesystem::addStorageWrapper('oc_encoding', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
234
+		\OC\Files\Filesystem::addStorageWrapper('oc_encoding', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
235 235
 			if ($mount->getOption('encoding_compatibility', false) && !$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) {
236 236
 				return new \OC\Files\Storage\Wrapper\Encoding(['storage' => $storage]);
237 237
 			}
238 238
 			return $storage;
239 239
 		});
240 240
 
241
-		\OC\Files\Filesystem::addStorageWrapper('oc_quota', function ($mountPoint, $storage) {
241
+		\OC\Files\Filesystem::addStorageWrapper('oc_quota', function($mountPoint, $storage) {
242 242
 			// set up quota for home storages, even for other users
243 243
 			// which can happen when using sharing
244 244
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 			return $storage;
262 262
 		});
263 263
 
264
-		\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
264
+		\OC\Files\Filesystem::addStorageWrapper('readonly', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
265 265
 			/*
266 266
 			 * Do not allow any operations that modify the storage
267 267
 			 */
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		//if we aren't logged in, there is no use to set up the filesystem
304 304
 		if ($user != "") {
305 305
 
306
-			$userDir = '/' . $user . '/files';
306
+			$userDir = '/'.$user.'/files';
307 307
 
308 308
 			//jail the user into his "home" directory
309 309
 			\OC\Files\Filesystem::init($user, $userDir);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			return \OCP\Files\FileInfo::SPACE_UNLIMITED;
384 384
 		}
385 385
 		$userQuota = $user->getQuota();
386
-		if($userQuota === 'none') {
386
+		if ($userQuota === 'none') {
387 387
 			return \OCP\Files\FileInfo::SPACE_UNLIMITED;
388 388
 		}
389 389
 		return OC_Helper::computerFileSize($userQuota);
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	 */
401 401
 	public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {
402 402
 
403
-		$plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
403
+		$plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT.'/core/skeleton');
404 404
 		$userLang = \OC::$server->getL10NFactory()->findLanguage();
405 405
 		$skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory);
406 406
 
@@ -422,9 +422,9 @@  discard block
 block discarded – undo
422 422
 		if ($instanceId === null) {
423 423
 			throw new \RuntimeException('no instance id!');
424 424
 		}
425
-		$appdata = 'appdata_' . $instanceId;
425
+		$appdata = 'appdata_'.$instanceId;
426 426
 		if ($userId === $appdata) {
427
-			throw new \RuntimeException('username is reserved name: ' . $appdata);
427
+			throw new \RuntimeException('username is reserved name: '.$appdata);
428 428
 		}
429 429
 
430 430
 		if (!empty($skeletonDirectory)) {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 
452 452
 		// Verify if folder exists
453 453
 		$dir = opendir($source);
454
-		if($dir === false) {
454
+		if ($dir === false) {
455 455
 			$logger->error(sprintf('Could not opendir "%s"', $source), ['app' => 'core']);
456 456
 			return;
457 457
 		}
@@ -459,14 +459,14 @@  discard block
 block discarded – undo
459 459
 		// Copy the files
460 460
 		while (false !== ($file = readdir($dir))) {
461 461
 			if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
462
-				if (is_dir($source . '/' . $file)) {
462
+				if (is_dir($source.'/'.$file)) {
463 463
 					$child = $target->newFolder($file);
464
-					self::copyr($source . '/' . $file, $child);
464
+					self::copyr($source.'/'.$file, $child);
465 465
 				} else {
466 466
 					$child = $target->newFile($file);
467
-					$sourceStream = fopen($source . '/' . $file, 'r');
468
-					if($sourceStream === false) {
469
-						$logger->error(sprintf('Could not fopen "%s"', $source . '/' . $file), ['app' => 'core']);
467
+					$sourceStream = fopen($source.'/'.$file, 'r');
468
+					if ($sourceStream === false) {
469
+						$logger->error(sprintf('Could not fopen "%s"', $source.'/'.$file), ['app' => 'core']);
470 470
 						closedir($dir);
471 471
 						return;
472 472
 					}
@@ -543,8 +543,8 @@  discard block
 block discarded – undo
543 543
 			return;
544 544
 		}
545 545
 
546
-		$timestamp = filemtime(OC::$SERVERROOT . '/version.php');
547
-		require OC::$SERVERROOT . '/version.php';
546
+		$timestamp = filemtime(OC::$SERVERROOT.'/version.php');
547
+		require OC::$SERVERROOT.'/version.php';
548 548
 		/** @var $timestamp int */
549 549
 		self::$versionCache['OC_Version_Timestamp'] = $timestamp;
550 550
 		/** @var $OC_Version string */
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 
592 592
 		// core js files need separate handling
593 593
 		if ($application !== 'core' && $file !== null) {
594
-			self::addTranslations ( $application );
594
+			self::addTranslations($application);
595 595
 		}
596 596
 		self::addExternalResource($application, $prepend, $path, "script");
597 597
 	}
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 		if ($type === "style") {
669 669
 			if (!in_array($path, self::$styles)) {
670 670
 				if ($prepend === true) {
671
-					array_unshift ( self::$styles, $path );
671
+					array_unshift(self::$styles, $path);
672 672
 				} else {
673 673
 					self::$styles[] = $path;
674 674
 				}
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 		} elseif ($type === "script") {
677 677
 			if (!in_array($path, self::$scripts)) {
678 678
 				if ($prepend === true) {
679
-					array_unshift ( self::$scripts, $path );
679
+					array_unshift(self::$scripts, $path);
680 680
 				} else {
681 681
 					self::$scripts [] = $path;
682 682
 				}
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 			'text' => $text
701 701
 		);
702 702
 		if ($prepend === true) {
703
-			array_unshift (self::$headers, $header);
703
+			array_unshift(self::$headers, $header);
704 704
 
705 705
 		} else {
706 706
 			self::$headers[] = $header;
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 	public static function checkServer(\OC\SystemConfig $config) {
717 717
 		$l = \OC::$server->getL10N('lib');
718 718
 		$errors = array();
719
-		$CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data');
719
+		$CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT.'/data');
720 720
 
721 721
 		if (!self::needUpgrade($config) && $config->getValue('installed', false)) {
722 722
 			// this check needs to be done every time
@@ -751,14 +751,14 @@  discard block
 block discarded – undo
751 751
 		}
752 752
 
753 753
 		// Check if config folder is writable.
754
-		if(!OC_Helper::isReadOnlyConfigEnabled()) {
754
+		if (!OC_Helper::isReadOnlyConfigEnabled()) {
755 755
 			if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
756 756
 				$errors[] = array(
757 757
 					'error' => $l->t('Cannot write into "config" directory'),
758 758
 					'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
759
-						[ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. '
759
+						[$urlGenerator->linkToDocs('admin-dir_permissions')]).'. '
760 760
 						. $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',
761
-						[ $urlGenerator->linkToDocs('admin-config') ] )
761
+						[$urlGenerator->linkToDocs('admin-config')])
762 762
 				);
763 763
 			}
764 764
 		}
@@ -892,15 +892,15 @@  discard block
 block discarded – undo
892 892
 			}
893 893
 		}
894 894
 
895
-		foreach($missingDependencies as $missingDependency) {
895
+		foreach ($missingDependencies as $missingDependency) {
896 896
 			$errors[] = array(
897 897
 				'error' => $l->t('PHP module %s not installed.', array($missingDependency)),
898 898
 				'hint' => $moduleHint
899 899
 			);
900 900
 			$webServerRestart = true;
901 901
 		}
902
-		foreach($invalidIniSettings as $setting) {
903
-			if(is_bool($setting[1])) {
902
+		foreach ($invalidIniSettings as $setting) {
903
+			if (is_bool($setting[1])) {
904 904
 				$setting[1] = $setting[1] ? 'on' : 'off';
905 905
 			}
906 906
 			$errors[] = [
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 		 * TODO: Should probably be implemented in the above generic dependency
919 919
 		 *       check somehow in the long-term.
920 920
 		 */
921
-		if($iniWrapper->getBool('mbstring.func_overload') !== null &&
921
+		if ($iniWrapper->getBool('mbstring.func_overload') !== null &&
922 922
 			$iniWrapper->getBool('mbstring.func_overload') === true) {
923 923
 			$errors[] = array(
924 924
 				'error' => $l->t('mbstring.func_overload is set to "%s" instead of the expected value "0"', [$iniWrapper->getString('mbstring.func_overload')]),
@@ -926,16 +926,16 @@  discard block
 block discarded – undo
926 926
 			);
927 927
 		}
928 928
 
929
-		if(function_exists('xml_parser_create') &&
930
-			LIBXML_LOADED_VERSION < 20700 ) {
929
+		if (function_exists('xml_parser_create') &&
930
+			LIBXML_LOADED_VERSION < 20700) {
931 931
 			$version = LIBXML_LOADED_VERSION;
932
-			$major = floor($version/10000);
932
+			$major = floor($version / 10000);
933 933
 			$version -= ($major * 10000);
934
-			$minor = floor($version/100);
934
+			$minor = floor($version / 100);
935 935
 			$version -= ($minor * 100);
936 936
 			$patch = $version;
937 937
 			$errors[] = array(
938
-				'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]),
938
+				'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major.'.'.$minor.'.'.$patch]),
939 939
 				'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.')
940 940
 			);
941 941
 		}
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 	 * @return array arrays with error messages and hints
1002 1002
 	 */
1003 1003
 	public static function checkDataDirectoryPermissions($dataDirectory) {
1004
-		if(\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) {
1004
+		if (\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) {
1005 1005
 			return  [];
1006 1006
 		}
1007 1007
 		$l = \OC::$server->getL10N('lib');
@@ -1039,10 +1039,10 @@  discard block
 block discarded – undo
1039 1039
 				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1040 1040
 			];
1041 1041
 		}
1042
-		if (!file_exists($dataDirectory . '/.ocdata')) {
1042
+		if (!file_exists($dataDirectory.'/.ocdata')) {
1043 1043
 			$errors[] = [
1044 1044
 				'error' => $l->t('Your data directory is invalid'),
1045
-				'hint' => $l->t('Ensure there is a file called ".ocdata"' .
1045
+				'hint' => $l->t('Ensure there is a file called ".ocdata"'.
1046 1046
 					' in the root of the data directory.')
1047 1047
 			];
1048 1048
 		}
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 	public static function checkLoggedIn() {
1059 1059
 		// Check if we are a user
1060 1060
 		if (!\OC::$server->getUserSession()->isLoggedIn()) {
1061
-			header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute(
1061
+			header('Location: '.\OC::$server->getURLGenerator()->linkToRoute(
1062 1062
 						'core.login.showLoginForm',
1063 1063
 						[
1064 1064
 							'redirect_url' => \OC::$server->getRequest()->getRequestUri(),
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
 		}
1070 1070
 		// Redirect to 2FA challenge selection if 2FA challenge was not solved yet
1071 1071
 		if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
1072
-			header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
1072
+			header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
1073 1073
 			exit();
1074 1074
 		}
1075 1075
 	}
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
 	public static function checkAdminUser() {
1083 1083
 		OC_Util::checkLoggedIn();
1084 1084
 		if (!OC_User::isAdminUser(OC_User::getUser())) {
1085
-			header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php'));
1085
+			header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php'));
1086 1086
 			exit();
1087 1087
 		}
1088 1088
 	}
@@ -1118,10 +1118,10 @@  discard block
 block discarded – undo
1118 1118
 					}
1119 1119
 				}
1120 1120
 
1121
-				if($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') {
1122
-					$location = $urlGenerator->getAbsoluteURL('/apps/' . $appId . '/');
1121
+				if ($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') {
1122
+					$location = $urlGenerator->getAbsoluteURL('/apps/'.$appId.'/');
1123 1123
 				} else {
1124
-					$location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/');
1124
+					$location = $urlGenerator->getAbsoluteURL('/index.php/apps/'.$appId.'/');
1125 1125
 				}
1126 1126
 			}
1127 1127
 		}
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 	 */
1136 1136
 	public static function redirectToDefaultPage() {
1137 1137
 		$location = self::getDefaultPageUrl();
1138
-		header('Location: ' . $location);
1138
+		header('Location: '.$location);
1139 1139
 		exit();
1140 1140
 	}
1141 1141
 
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
 		$id = \OC::$server->getSystemConfig()->getValue('instanceid', null);
1149 1149
 		if (is_null($id)) {
1150 1150
 			// We need to guarantee at least one letter in instanceid so it can be used as the session_name
1151
-			$id = 'oc' . \OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
1151
+			$id = 'oc'.\OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
1152 1152
 			\OC::$server->getSystemConfig()->setValue('instanceid', $id);
1153 1153
 		}
1154 1154
 		return $id;
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
 			}, $value);
1171 1171
 		} else {
1172 1172
 			// Specify encoding for PHP<5.4
1173
-			$value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8');
1173
+			$value = htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8');
1174 1174
 		}
1175 1175
 		return $value;
1176 1176
 	}
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 		$testContent = 'This is used for testing whether htaccess is properly enabled to disallow access from the outside. This file can be safely removed.';
1204 1204
 
1205 1205
 		// creating a test file
1206
-		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
1206
+		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName;
1207 1207
 
1208 1208
 		if (file_exists($testFile)) {// already running this test, possible recursive call
1209 1209
 			return false;
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 		$fp = @fopen($testFile, 'w');
1213 1213
 		if (!$fp) {
1214 1214
 			throw new OC\HintException('Can\'t create test file to check for working .htaccess file.',
1215
-				'Make sure it is possible for the webserver to write to ' . $testFile);
1215
+				'Make sure it is possible for the webserver to write to '.$testFile);
1216 1216
 		}
1217 1217
 		fwrite($fp, $testContent);
1218 1218
 		fclose($fp);
@@ -1239,10 +1239,10 @@  discard block
 block discarded – undo
1239 1239
 		}
1240 1240
 
1241 1241
 		$fileName = '/htaccesstest.txt';
1242
-		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
1242
+		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName;
1243 1243
 
1244 1244
 		// accessing the file via http
1245
-		$url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName);
1245
+		$url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT.'/data'.$fileName);
1246 1246
 		try {
1247 1247
 			$content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody();
1248 1248
 		} catch (\Exception $e) {
@@ -1324,7 +1324,7 @@  discard block
 block discarded – undo
1324 1324
 		$theme = \OC::$server->getSystemConfig()->getValue("theme", '');
1325 1325
 
1326 1326
 		if ($theme === '') {
1327
-			if (is_dir(OC::$SERVERROOT . '/themes/default')) {
1327
+			if (is_dir(OC::$SERVERROOT.'/themes/default')) {
1328 1328
 				$theme = 'default';
1329 1329
 			}
1330 1330
 		}
@@ -1339,13 +1339,13 @@  discard block
 block discarded – undo
1339 1339
 	 * @return bool|string
1340 1340
 	 */
1341 1341
 	public static function normalizeUnicode($value) {
1342
-		if(Normalizer::isNormalized($value)) {
1342
+		if (Normalizer::isNormalized($value)) {
1343 1343
 			return $value;
1344 1344
 		}
1345 1345
 
1346 1346
 		$normalizedValue = Normalizer::normalize($value);
1347 1347
 		if ($normalizedValue === null || $normalizedValue === false) {
1348
-			\OC::$server->getLogger()->warning('normalizing failed for "' . $value . '"', ['app' => 'core']);
1348
+			\OC::$server->getLogger()->warning('normalizing failed for "'.$value.'"', ['app' => 'core']);
1349 1349
 			return $value;
1350 1350
 		}
1351 1351
 
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 		$version = OC_Util::getVersionString();
1362 1362
 		$build = OC_Util::getBuild();
1363 1363
 		if (!empty($build) and OC_Util::getChannel() === 'daily') {
1364
-			$version .= ' Build:' . $build;
1364
+			$version .= ' Build:'.$build;
1365 1365
 		}
1366 1366
 		return $version;
1367 1367
 	}
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 		}
1384 1384
 
1385 1385
 		// detect part files
1386
-		if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) {
1386
+		if (preg_match('/'.\OCP\Files\FileInfo::BLACKLIST_FILES_REGEX.'/', $trimmed) !== 0) {
1387 1387
 			return false;
1388 1388
 		}
1389 1389
 
@@ -1414,19 +1414,19 @@  discard block
 block discarded – undo
1414 1414
 			} else if ($config->getValue('debug', false) && $versionDiff < 0) {
1415 1415
 				// downgrade with debug
1416 1416
 				$installedMajor = explode('.', $installedVersion);
1417
-				$installedMajor = $installedMajor[0] . '.' . $installedMajor[1];
1417
+				$installedMajor = $installedMajor[0].'.'.$installedMajor[1];
1418 1418
 				$currentMajor = explode('.', $currentVersion);
1419
-				$currentMajor = $currentMajor[0] . '.' . $currentMajor[1];
1419
+				$currentMajor = $currentMajor[0].'.'.$currentMajor[1];
1420 1420
 				if ($installedMajor === $currentMajor) {
1421 1421
 					// Same major, allow downgrade for developers
1422 1422
 					return true;
1423 1423
 				} else {
1424 1424
 					// downgrade attempt, throw exception
1425
-					throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
1425
+					throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')');
1426 1426
 				}
1427 1427
 			} else if ($versionDiff < 0) {
1428 1428
 				// downgrade attempt, throw exception
1429
-				throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
1429
+				throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')');
1430 1430
 			}
1431 1431
 
1432 1432
 			// also check for upgrades for apps (independently from the user)
Please login to merge, or discard this patch.