Code Duplication    Length = 3-3 lines in 3 locations

lib/private/Files/Storage/DAV.php 1 location

@@ 120-122 (lines=3) @@
117
				$this->secure = false;
118
			}
119
			$this->root = isset($params['root']) ? $params['root'] : '/';
120
			if (!$this->root || $this->root[0] != '/') {
121
				$this->root = '/' . $this->root;
122
			}
123
			if (\substr($this->root, -1, 1) != '/') {
124
				$this->root .= '/';
125
			}

apps/files_sharing/lib/External/Storage.php 1 location

@@ 101-103 (lines=3) @@
98
		);
99
100
		$this->root = \rtrim($this->root, '/') . $discoveryManager->getWebDavEndpoint($this->remote);
101
		if (!$this->root || $this->root[0] !== '/') {
102
			$this->root = '/' . $this->root;
103
		}
104
		if (\substr($this->root, -1, 1) !== '/') {
105
			$this->root .= '/';
106
		}

apps/files_external/lib/Lib/Storage/SMB.php 1 location

@@ 93-95 (lines=3) @@
90
			$this->log("using $shareClass for the connection");
91
92
			$this->root = isset($params['root']) ? $params['root'] : '/';
93
			if (!$this->root || $this->root[0] != '/') {
94
				$this->root = '/' . $this->root;
95
			}
96
			if (\substr($this->root, -1, 1) != '/') {
97
				$this->root .= '/';
98
			}