Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 58-60 (lines=3) @@
55
				$this->secure = false;
56
			}
57
			$this->root=isset($params['root'])?$params['root']:'/';
58
			if ( ! $this->root || $this->root[0]!='/') {
59
				$this->root='/'.$this->root;
60
			}
61
			if (substr($this->root, -1) !== '/') {
62
				$this->root .= '/';
63
			}

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

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

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

@@ 81-83 (lines=3) @@
78
			$this->share = $this->server->getShare(trim($params['share'], '/'));
79
80
			$this->root = isset($params['root']) ? $params['root'] : '/';
81
			if (!$this->root || $this->root[0] != '/') {
82
				$this->root = '/' . $this->root;
83
			}
84
			if (substr($this->root, -1, 1) != '/') {
85
				$this->root .= '/';
86
			}