Code Duplication    Length = 5-6 lines in 2 locations

apps/files_external/lib/config.php 1 location

@@ 259-263 (lines=5) @@
256
	public static function readData($user = null) {
257
		if (isset($user)) {
258
			$jsonFile = \OC::$server->getUserManager()->get($user)->getHome() . '/mount.json';
259
		} else {
260
			$config = \OC::$server->getConfig();
261
			$datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
262
			$jsonFile = $config->getSystemValue('mount_file', $datadir . '/mount.json');
263
		}
264
		if (is_file($jsonFile)) {
265
			$mountPoints = json_decode(file_get_contents($jsonFile), true);
266
			if (is_array($mountPoints)) {

lib/private/Installer.php 1 location

@@ 365-370 (lines=6) @@
362
		// whether the application needs to be signed.
363
		$appId = OC_App::cleanAppId($data['appdata']['id']);
364
		$appBelongingToId = OC_App::getInternalAppIdByOcs($appId);
365
		if(is_string($appBelongingToId)) {
366
			$previouslySigned = \OC::$server->getConfig()->getAppValue($appBelongingToId, 'signed', 'false');
367
		} else {
368
			$appBelongingToId = $info['id'];
369
			$previouslySigned = 'false';
370
		}
371
		if($data['appdata']['level'] === OC_App::officialApp || $previouslySigned === 'true') {
372
			\OC::$server->getConfig()->setAppValue($appBelongingToId, 'signed', 'true');
373
			$integrityResult = \OC::$server->getIntegrityCodeChecker()->verifyAppSignature(