Code Duplication    Length = 8-9 lines in 2 locations

remote.php 1 location

@@ 140-147 (lines=8) @@
137
138
	$file = resolveService($service);
139
140
	if ($file === null) {
141
		$dispatcher = \OC::$server->getEventDispatcher();
142
		$dispatcher->dispatch(\OCP\Http\HttpEvents::EVENT_404, new OCP\Http\HttpEvents(
143
			\OCP\Http\HttpEvents::EVENT_404,
144
			OC::$server->getRequest()
145
		));
146
		throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND);
147
	}
148
149
	// force language as given in the http request
150
	\OC::$server->getL10NFactory()->setLanguageFromRequest();

public.php 1 location

@@ 59-67 (lines=9) @@
56
		list($service) = \explode('/', $pathInfo);
57
	}
58
	$file = \OC::$server->getConfig()->getAppValue('core', 'public_' . \strip_tags($service));
59
	if ($file === null) {
60
		\header('HTTP/1.0 404 Not Found');
61
		$dispatcher = \OC::$server->getEventDispatcher();
62
		$dispatcher->dispatch(\OCP\Http\HttpEvents::EVENT_404, new OCP\Http\HttpEvents(
63
			\OCP\Http\HttpEvents::EVENT_404,
64
			OC::$server->getRequest()
65
		));
66
		exit;
67
	}
68
69
	$parts = \explode('/', $file, 2);
70
	$app = $parts[0];