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
			}

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

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

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
			}