Code Duplication    Length = 9-9 lines in 3 locations

lib/private/Share/Share.php 1 location

@@ 2656-2664 (lines=9) @@
2653
	 * @param string $url
2654
	 * @return string
2655
	 */
2656
	public static function removeProtocolFromUrl($url) {
2657
		if (strpos($url, 'https://') === 0) {
2658
			return substr($url, strlen('https://'));
2659
		} else if (strpos($url, 'http://') === 0) {
2660
			return substr($url, strlen('http://'));
2661
		}
2662
2663
		return $url;
2664
	}
2665
2666
	/**
2667
	 * try http post first with https and then with http as a fallback

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

@@ 422-430 (lines=9) @@
419
	 * @param string $url
420
	 * @return string
421
	 */
422
	private function removeProtocolFromUrl($url) {
423
		if (strpos($url, 'https://') === 0) {
424
			return substr($url, strlen('https://'));
425
		} else if (strpos($url, 'http://') === 0) {
426
			return substr($url, strlen('http://'));
427
		}
428
429
		return $url;
430
	}
431
432
	public function triggerChange($feature, $value = null) {
433
		if ($this->emitter) {