Code Duplication    Length = 7-7 lines in 2 locations

lib/AppInfo/Application.php 1 location

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

lib/Controller/DocumentController.php 1 location

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