Code Duplication    Length = 9-9 lines in 3 locations

apps/federatedfilesharing/lib/AddressHandler.php 1 location

@@ 129-137 (lines=9) @@
126
	 * @param string $url
127
	 * @return string
128
	 */
129
	public function removeProtocolFromUrl($url) {
130
		if (strpos($url, 'https://') === 0) {
131
			return substr($url, strlen('https://'));
132
		} else if (strpos($url, 'http://') === 0) {
133
			return substr($url, strlen('http://'));
134
		}
135
136
		return $url;
137
	}
138
139
	/**
140
	 * check if the url contain the protocol (http or https)

lib/private/User/User.php 1 location

@@ 443-451 (lines=9) @@
440
	 * @param string $url
441
	 * @return string
442
	 */
443
	private function removeProtocolFromUrl($url) {
444
		if (strpos($url, 'https://') === 0) {
445
			return substr($url, strlen('https://'));
446
		} else if (strpos($url, 'http://') === 0) {
447
			return substr($url, strlen('http://'));
448
		}
449
450
		return $url;
451
	}
452
453
	public function triggerChange($feature, $value = null, $oldValue = null) {
454
		if ($this->emitter) {

lib/private/Share/Share.php 1 location

@@ 2047-2055 (lines=9) @@
2044
	 * @param string $url
2045
	 * @return string
2046
	 */
2047
	public static function removeProtocolFromUrl($url) {
2048
		if (strpos($url, 'https://') === 0) {
2049
			return substr($url, strlen('https://'));
2050
		} else if (strpos($url, 'http://') === 0) {
2051
			return substr($url, strlen('http://'));
2052
		}
2053
2054
		return $url;
2055
	}
2056
2057
	/**
2058
	 * try http post first with https and then with http as a fallback