Code Duplication    Length = 3-3 lines in 3 locations

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/FTP.php 1 location

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

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

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