Code Duplication    Length = 3-3 lines in 3 locations

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

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

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

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

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

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