Code Duplication    Length = 9-9 lines in 3 locations

lib/private/User/RemoteUser.php 1 location

@@ 168-176 (lines=9) @@
165
	 * @param string $url
166
	 * @return string
167
	 */
168
	private function removeProtocolFromUrl($url) {
169
		if (\strpos($url, 'https://') === 0) {
170
			return \substr($url, \strlen('https://'));
171
		} elseif (\strpos($url, 'http://') === 0) {
172
			return \substr($url, \strlen('http://'));
173
		}
174
175
		return $url;
176
	}
177
178
	/**
179
	 * @inheritdoc

lib/private/User/User.php 1 location

@@ 470-478 (lines=9) @@
467
	 * @param string $url
468
	 * @return string
469
	 */
470
	private function removeProtocolFromUrl($url) {
471
		if (\strpos($url, 'https://') === 0) {
472
			return \substr($url, \strlen('https://'));
473
		} elseif (\strpos($url, 'http://') === 0) {
474
			return \substr($url, \strlen('http://'));
475
		}
476
477
		return $url;
478
	}
479
480
	public function triggerChange($feature, $value = null) {
481
		if ($this->emitter && \in_array($feature, $this->account->getUpdatedFields())) {

lib/private/Share/Share.php 1 location

@@ 596-604 (lines=9) @@
593
	 * @param string $url
594
	 * @return string
595
	 */
596
	public static function removeProtocolFromUrl($url) {
597
		if (\strpos($url, 'https://') === 0) {
598
			return \substr($url, \strlen('https://'));
599
		} elseif (\strpos($url, 'http://') === 0) {
600
			return \substr($url, \strlen('http://'));
601
		}
602
603
		return $url;
604
	}
605
606
	/**
607
	 * try http post first with https and then with http as a fallback