Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 90-92 (lines=3) @@
87
			$this->share = $this->server->getShare(trim($params['share'], '/'));
88
89
			$this->root = isset($params['root']) ? $params['root'] : '/';
90
			if (!$this->root || $this->root[0] != '/') {
91
				$this->root = '/' . $this->root;
92
			}
93
			if (substr($this->root, -1, 1) != '/') {
94
				$this->root .= '/';
95
			}

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

@@ 124-126 (lines=3) @@
121
				}
122
			}
123
			$this->root = isset($params['root']) ? $params['root'] : '/';
124
			if (!$this->root || $this->root[0] != '/') {
125
				$this->root = '/' . $this->root;
126
			}
127
			if (substr($this->root, -1, 1) != '/') {
128
				$this->root .= '/';
129
			}

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
		}