Completed
Pull Request — master (#7334)
by Joas
14:56
created
lib/private/legacy/util.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 	private static function initLocalStorageRootFS() {
82 82
 		// mount local file backend as root
83
-		$configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT . "/data");
83
+		$configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT."/data");
84 84
 		//first set up the local "root" storage
85 85
 		\OC\Files\Filesystem::initMountManager();
86 86
 		if (!self::$rootMounted) {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		\OC\Files\Filesystem::initMountManager();
203 203
 
204 204
 		\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
205
-		\OC\Files\Filesystem::addStorageWrapper('mount_options', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
205
+		\OC\Files\Filesystem::addStorageWrapper('mount_options', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
206 206
 			if ($storage->instanceOfStorage('\OC\Files\Storage\Common')) {
207 207
 				/** @var \OC\Files\Storage\Common $storage */
208 208
 				$storage->setMountOptions($mount->getOptions());
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			return $storage;
211 211
 		});
212 212
 
213
-		\OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
213
+		\OC\Files\Filesystem::addStorageWrapper('enable_sharing', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
214 214
 			if (!$mount->getOption('enable_sharing', true)) {
215 215
 				return new \OC\Files\Storage\Wrapper\PermissionsMask([
216 216
 					'storage' => $storage,
@@ -221,21 +221,21 @@  discard block
 block discarded – undo
221 221
 		});
222 222
 
223 223
 		// install storage availability wrapper, before most other wrappers
224
-		\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, \OCP\Files\Storage\IStorage $storage) {
224
+		\OC\Files\Filesystem::addStorageWrapper('oc_availability', function($mountPoint, \OCP\Files\Storage\IStorage $storage) {
225 225
 			if (!$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) {
226 226
 				return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]);
227 227
 			}
228 228
 			return $storage;
229 229
 		});
230 230
 
231
-		\OC\Files\Filesystem::addStorageWrapper('oc_encoding', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
231
+		\OC\Files\Filesystem::addStorageWrapper('oc_encoding', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
232 232
 			if ($mount->getOption('encoding_compatibility', false) && !$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) {
233 233
 				return new \OC\Files\Storage\Wrapper\Encoding(['storage' => $storage]);
234 234
 			}
235 235
 			return $storage;
236 236
 		});
237 237
 
238
-		\OC\Files\Filesystem::addStorageWrapper('oc_quota', function ($mountPoint, $storage) {
238
+		\OC\Files\Filesystem::addStorageWrapper('oc_quota', function($mountPoint, $storage) {
239 239
 			// set up quota for home storages, even for other users
240 240
 			// which can happen when using sharing
241 241
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 		//if we aren't logged in, there is no use to set up the filesystem
283 283
 		if ($user != "") {
284 284
 
285
-			$userDir = '/' . $user . '/files';
285
+			$userDir = '/'.$user.'/files';
286 286
 
287 287
 			//jail the user into his "home" directory
288 288
 			\OC\Files\Filesystem::init($user, $userDir);
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 			return \OCP\Files\FileInfo::SPACE_UNLIMITED;
364 364
 		}
365 365
 		$userQuota = $user->getQuota();
366
-		if($userQuota === 'none') {
366
+		if ($userQuota === 'none') {
367 367
 			return \OCP\Files\FileInfo::SPACE_UNLIMITED;
368 368
 		}
369 369
 		return OC_Helper::computerFileSize($userQuota);
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 	 */
380 380
 	public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {
381 381
 
382
-		$plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
382
+		$plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT.'/core/skeleton');
383 383
 		$userLang = \OC::$server->getL10NFactory()->findLanguage();
384 384
 		$skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory);
385 385
 
@@ -398,9 +398,9 @@  discard block
 block discarded – undo
398 398
 		if ($instanceId === null) {
399 399
 			throw new \RuntimeException('no instance id!');
400 400
 		}
401
-		$appdata = 'appdata_' . $instanceId;
401
+		$appdata = 'appdata_'.$instanceId;
402 402
 		if ($userId === $appdata) {
403
-			throw new \RuntimeException('username is reserved name: ' . $appdata);
403
+			throw new \RuntimeException('username is reserved name: '.$appdata);
404 404
 		}
405 405
 
406 406
 		if (!empty($skeletonDirectory)) {
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 
428 428
 		// Verify if folder exists
429 429
 		$dir = opendir($source);
430
-		if($dir === false) {
430
+		if ($dir === false) {
431 431
 			$logger->error(sprintf('Could not opendir "%s"', $source), ['app' => 'core']);
432 432
 			return;
433 433
 		}
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
 		// Copy the files
436 436
 		while (false !== ($file = readdir($dir))) {
437 437
 			if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
438
-				if (is_dir($source . '/' . $file)) {
438
+				if (is_dir($source.'/'.$file)) {
439 439
 					$child = $target->newFolder($file);
440
-					self::copyr($source . '/' . $file, $child);
440
+					self::copyr($source.'/'.$file, $child);
441 441
 				} else {
442 442
 					$child = $target->newFile($file);
443
-					$sourceStream = fopen($source . '/' . $file, 'r');
444
-					if($sourceStream === false) {
445
-						$logger->error(sprintf('Could not fopen "%s"', $source . '/' . $file), ['app' => 'core']);
443
+					$sourceStream = fopen($source.'/'.$file, 'r');
444
+					if ($sourceStream === false) {
445
+						$logger->error(sprintf('Could not fopen "%s"', $source.'/'.$file), ['app' => 'core']);
446 446
 						closedir($dir);
447 447
 						return;
448 448
 					}
@@ -519,8 +519,8 @@  discard block
 block discarded – undo
519 519
 			return;
520 520
 		}
521 521
 
522
-		$timestamp = filemtime(OC::$SERVERROOT . '/version.php');
523
-		require OC::$SERVERROOT . '/version.php';
522
+		$timestamp = filemtime(OC::$SERVERROOT.'/version.php');
523
+		require OC::$SERVERROOT.'/version.php';
524 524
 		/** @var $timestamp int */
525 525
 		self::$versionCache['OC_Version_Timestamp'] = $timestamp;
526 526
 		/** @var $OC_Version string */
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 
568 568
 		// core js files need separate handling
569 569
 		if ($application !== 'core' && $file !== null) {
570
-			self::addTranslations ( $application );
570
+			self::addTranslations($application);
571 571
 		}
572 572
 		self::addExternalResource($application, $prepend, $path, "script");
573 573
 	}
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 		if ($type === "style") {
645 645
 			if (!in_array($path, self::$styles)) {
646 646
 				if ($prepend === true) {
647
-					array_unshift ( self::$styles, $path );
647
+					array_unshift(self::$styles, $path);
648 648
 				} else {
649 649
 					self::$styles[] = $path;
650 650
 				}
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 		} elseif ($type === "script") {
653 653
 			if (!in_array($path, self::$scripts)) {
654 654
 				if ($prepend === true) {
655
-					array_unshift ( self::$scripts, $path );
655
+					array_unshift(self::$scripts, $path);
656 656
 				} else {
657 657
 					self::$scripts [] = $path;
658 658
 				}
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 	 * @param array $attributes array of attributes for the element
669 669
 	 * @param string $text the text content for the element
670 670
 	 */
671
-	public static function addHeader($tag, $attributes, $text=null) {
671
+	public static function addHeader($tag, $attributes, $text = null) {
672 672
 		self::$headers[] = array(
673 673
 			'tag' => $tag,
674 674
 			'attributes' => $attributes,
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 	public static function checkServer(\OC\SystemConfig $config) {
709 709
 		$l = \OC::$server->getL10N('lib');
710 710
 		$errors = array();
711
-		$CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data');
711
+		$CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT.'/data');
712 712
 
713 713
 		if (!self::needUpgrade($config) && $config->getValue('installed', false)) {
714 714
 			// this check needs to be done every time
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
 		}
744 744
 
745 745
 		// Check if config folder is writable.
746
-		if(!OC_Helper::isReadOnlyConfigEnabled()) {
746
+		if (!OC_Helper::isReadOnlyConfigEnabled()) {
747 747
 			if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
748 748
 				$errors[] = array(
749 749
 					'error' => $l->t('Cannot write into "config" directory'),
@@ -883,15 +883,15 @@  discard block
 block discarded – undo
883 883
 			}
884 884
 		}
885 885
 
886
-		foreach($missingDependencies as $missingDependency) {
886
+		foreach ($missingDependencies as $missingDependency) {
887 887
 			$errors[] = array(
888 888
 				'error' => $l->t('PHP module %s not installed.', array($missingDependency)),
889 889
 				'hint' => $moduleHint
890 890
 			);
891 891
 			$webServerRestart = true;
892 892
 		}
893
-		foreach($invalidIniSettings as $setting) {
894
-			if(is_bool($setting[1])) {
893
+		foreach ($invalidIniSettings as $setting) {
894
+			if (is_bool($setting[1])) {
895 895
 				$setting[1] = ($setting[1]) ? 'on' : 'off';
896 896
 			}
897 897
 			$errors[] = [
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
 		 * TODO: Should probably be implemented in the above generic dependency
910 910
 		 *       check somehow in the long-term.
911 911
 		 */
912
-		if($iniWrapper->getBool('mbstring.func_overload') !== null &&
912
+		if ($iniWrapper->getBool('mbstring.func_overload') !== null &&
913 913
 			$iniWrapper->getBool('mbstring.func_overload') === true) {
914 914
 			$errors[] = array(
915 915
 				'error' => $l->t('mbstring.func_overload is set to "%s" instead of the expected value "0"', [$iniWrapper->getString('mbstring.func_overload')]),
@@ -917,16 +917,16 @@  discard block
 block discarded – undo
917 917
 			);
918 918
 		}
919 919
 
920
-		if(function_exists('xml_parser_create') &&
921
-			LIBXML_LOADED_VERSION < 20700 ) {
920
+		if (function_exists('xml_parser_create') &&
921
+			LIBXML_LOADED_VERSION < 20700) {
922 922
 			$version = LIBXML_LOADED_VERSION;
923
-			$major = floor($version/10000);
923
+			$major = floor($version / 10000);
924 924
 			$version -= ($major * 10000);
925
-			$minor = floor($version/100);
925
+			$minor = floor($version / 100);
926 926
 			$version -= ($minor * 100);
927 927
 			$patch = $version;
928 928
 			$errors[] = array(
929
-				'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]),
929
+				'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major.'.'.$minor.'.'.$patch]),
930 930
 				'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.')
931 931
 			);
932 932
 		}
@@ -1027,10 +1027,10 @@  discard block
 block discarded – undo
1027 1027
 				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1028 1028
 			];
1029 1029
 		}
1030
-		if (!file_exists($dataDirectory . '/.ocdata')) {
1030
+		if (!file_exists($dataDirectory.'/.ocdata')) {
1031 1031
 			$errors[] = [
1032 1032
 				'error' => $l->t('Your data directory is invalid'),
1033
-				'hint' => $l->t('Ensure there is a file called ".ocdata"' .
1033
+				'hint' => $l->t('Ensure there is a file called ".ocdata"'.
1034 1034
 					' in the root of the data directory.')
1035 1035
 			];
1036 1036
 		}
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 	public static function checkLoggedIn() {
1047 1047
 		// Check if we are a user
1048 1048
 		if (!\OC::$server->getUserSession()->isLoggedIn()) {
1049
-			header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute(
1049
+			header('Location: '.\OC::$server->getURLGenerator()->linkToRoute(
1050 1050
 						'core.login.showLoginForm',
1051 1051
 						[
1052 1052
 							'redirect_url' => \OC::$server->getRequest()->getRequestUri(),
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 		}
1058 1058
 		// Redirect to 2FA challenge selection if 2FA challenge was not solved yet
1059 1059
 		if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
1060
-			header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
1060
+			header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
1061 1061
 			exit();
1062 1062
 		}
1063 1063
 	}
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 	public static function checkAdminUser() {
1071 1071
 		OC_Util::checkLoggedIn();
1072 1072
 		if (!OC_User::isAdminUser(OC_User::getUser())) {
1073
-			header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php'));
1073
+			header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php'));
1074 1074
 			exit();
1075 1075
 		}
1076 1076
 	}
@@ -1084,12 +1084,12 @@  discard block
 block discarded – undo
1084 1084
 		OC_Util::checkLoggedIn();
1085 1085
 		$userObject = \OC::$server->getUserSession()->getUser();
1086 1086
 		$isSubAdmin = false;
1087
-		if($userObject !== null) {
1087
+		if ($userObject !== null) {
1088 1088
 			$isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
1089 1089
 		}
1090 1090
 
1091 1091
 		if (!$isSubAdmin) {
1092
-			header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php'));
1092
+			header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php'));
1093 1093
 			exit();
1094 1094
 		}
1095 1095
 		return true;
@@ -1126,10 +1126,10 @@  discard block
 block discarded – undo
1126 1126
 					}
1127 1127
 				}
1128 1128
 
1129
-				if($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') {
1130
-					$location = $urlGenerator->getAbsoluteURL('/apps/' . $appId . '/');
1129
+				if ($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') {
1130
+					$location = $urlGenerator->getAbsoluteURL('/apps/'.$appId.'/');
1131 1131
 				} else {
1132
-					$location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/');
1132
+					$location = $urlGenerator->getAbsoluteURL('/index.php/apps/'.$appId.'/');
1133 1133
 				}
1134 1134
 			}
1135 1135
 		}
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
 	 */
1144 1144
 	public static function redirectToDefaultPage() {
1145 1145
 		$location = self::getDefaultPageUrl();
1146
-		header('Location: ' . $location);
1146
+		header('Location: '.$location);
1147 1147
 		exit();
1148 1148
 	}
1149 1149
 
@@ -1156,7 +1156,7 @@  discard block
 block discarded – undo
1156 1156
 		$id = \OC::$server->getSystemConfig()->getValue('instanceid', null);
1157 1157
 		if (is_null($id)) {
1158 1158
 			// We need to guarantee at least one letter in instanceid so it can be used as the session_name
1159
-			$id = 'oc' . \OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
1159
+			$id = 'oc'.\OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
1160 1160
 			\OC::$server->getSystemConfig()->setValue('instanceid', $id);
1161 1161
 		}
1162 1162
 		return $id;
@@ -1178,7 +1178,7 @@  discard block
 block discarded – undo
1178 1178
 			}, $value);
1179 1179
 		} else {
1180 1180
 			// Specify encoding for PHP<5.4
1181
-			$value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8');
1181
+			$value = htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8');
1182 1182
 		}
1183 1183
 		return $value;
1184 1184
 	}
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 		$testContent = 'This is used for testing whether htaccess is properly enabled to disallow access from the outside. This file can be safely removed.';
1212 1212
 
1213 1213
 		// creating a test file
1214
-		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
1214
+		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName;
1215 1215
 
1216 1216
 		if (file_exists($testFile)) {// already running this test, possible recursive call
1217 1217
 			return false;
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
 		$fp = @fopen($testFile, 'w');
1221 1221
 		if (!$fp) {
1222 1222
 			throw new OC\HintException('Can\'t create test file to check for working .htaccess file.',
1223
-				'Make sure it is possible for the webserver to write to ' . $testFile);
1223
+				'Make sure it is possible for the webserver to write to '.$testFile);
1224 1224
 		}
1225 1225
 		fwrite($fp, $testContent);
1226 1226
 		fclose($fp);
@@ -1247,10 +1247,10 @@  discard block
 block discarded – undo
1247 1247
 		}
1248 1248
 
1249 1249
 		$fileName = '/htaccesstest.txt';
1250
-		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
1250
+		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName;
1251 1251
 
1252 1252
 		// accessing the file via http
1253
-		$url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName);
1253
+		$url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT.'/data'.$fileName);
1254 1254
 		try {
1255 1255
 			$content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody();
1256 1256
 		} catch (\Exception $e) {
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 		$theme = \OC::$server->getSystemConfig()->getValue("theme", '');
1342 1342
 
1343 1343
 		if ($theme === '') {
1344
-			if (is_dir(OC::$SERVERROOT . '/themes/default')) {
1344
+			if (is_dir(OC::$SERVERROOT.'/themes/default')) {
1345 1345
 				$theme = 'default';
1346 1346
 			}
1347 1347
 		}
@@ -1414,13 +1414,13 @@  discard block
 block discarded – undo
1414 1414
 	 * @return bool|string
1415 1415
 	 */
1416 1416
 	public static function normalizeUnicode($value) {
1417
-		if(Normalizer::isNormalized($value)) {
1417
+		if (Normalizer::isNormalized($value)) {
1418 1418
 			return $value;
1419 1419
 		}
1420 1420
 
1421 1421
 		$normalizedValue = Normalizer::normalize($value);
1422 1422
 		if ($normalizedValue === null || $normalizedValue === false) {
1423
-			\OC::$server->getLogger()->warning('normalizing failed for "' . $value . '"', ['app' => 'core']);
1423
+			\OC::$server->getLogger()->warning('normalizing failed for "'.$value.'"', ['app' => 'core']);
1424 1424
 			return $value;
1425 1425
 		}
1426 1426
 
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 		$version = OC_Util::getVersionString();
1437 1437
 		$build = OC_Util::getBuild();
1438 1438
 		if (!empty($build) and OC_Util::getChannel() === 'daily') {
1439
-			$version .= ' Build:' . $build;
1439
+			$version .= ' Build:'.$build;
1440 1440
 		}
1441 1441
 		return $version;
1442 1442
 	}
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
 		}
1459 1459
 
1460 1460
 		// detect part files
1461
-		if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) {
1461
+		if (preg_match('/'.\OCP\Files\FileInfo::BLACKLIST_FILES_REGEX.'/', $trimmed) !== 0) {
1462 1462
 			return false;
1463 1463
 		}
1464 1464
 
@@ -1489,19 +1489,19 @@  discard block
 block discarded – undo
1489 1489
 			} else if ($config->getValue('debug', false) && $versionDiff < 0) {
1490 1490
 				// downgrade with debug
1491 1491
 				$installedMajor = explode('.', $installedVersion);
1492
-				$installedMajor = $installedMajor[0] . '.' . $installedMajor[1];
1492
+				$installedMajor = $installedMajor[0].'.'.$installedMajor[1];
1493 1493
 				$currentMajor = explode('.', $currentVersion);
1494
-				$currentMajor = $currentMajor[0] . '.' . $currentMajor[1];
1494
+				$currentMajor = $currentMajor[0].'.'.$currentMajor[1];
1495 1495
 				if ($installedMajor === $currentMajor) {
1496 1496
 					// Same major, allow downgrade for developers
1497 1497
 					return true;
1498 1498
 				} else {
1499 1499
 					// downgrade attempt, throw exception
1500
-					throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
1500
+					throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')');
1501 1501
 				}
1502 1502
 			} else if ($versionDiff < 0) {
1503 1503
 				// downgrade attempt, throw exception
1504
-				throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')');
1504
+				throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')');
1505 1505
 			}
1506 1506
 
1507 1507
 			// also check for upgrades for apps (independently from the user)
Please login to merge, or discard this patch.