Code Duplication    Length = 9-9 lines in 3 locations

apps/federatedfilesharing/lib/AddressHandler.php 1 location

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

lib/private/User/User.php 1 location

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

lib/private/Share/Share.php 1 location

@@ 1970-1978 (lines=9) @@
1967
	 * @param string $url
1968
	 * @return string
1969
	 */
1970
	public static function removeProtocolFromUrl($url) {
1971
		if (strpos($url, 'https://') === 0) {
1972
			return substr($url, strlen('https://'));
1973
		} else if (strpos($url, 'http://') === 0) {
1974
			return substr($url, strlen('http://'));
1975
		}
1976
1977
		return $url;
1978
	}
1979
1980
	/**
1981
	 * try http post first with https and then with http as a fallback