Code Duplication    Length = 7-7 lines in 2 locations

lib/AppInfo/Application.php 1 location

@@ 56-62 (lines=7) @@
53
	 * @param string $url
54
	 * @return string
55
	 */
56
	private function domainOnly($url) {
57
		$parsed_url = parse_url($url);
58
		$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
59
		$host	= isset($parsed_url['host']) ? $parsed_url['host'] : '';
60
		$port	= isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
61
		return "$scheme$host$port";
62
	}
63
64
	public function __construct(array $urlParams = array()) {
65
		parent::__construct(self::APPNAME, $urlParams);

lib/Controller/DocumentController.php 1 location

@@ 169-175 (lines=7) @@
166
	 * @param string $url
167
	 * @return string
168
	 */
169
	private function domainOnly($url) {
170
		$parsed_url = parse_url($url);
171
		$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
172
		$host   = isset($parsed_url['host']) ? $parsed_url['host'] : '';
173
		$port   = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
174
		return "$scheme$host$port";
175
	}
176
177
	/**
178
	 * Redirect to the files app with proper CSP headers set for federated editing