Code Duplication    Length = 3-3 lines in 3 locations

apps/files_external/lib/ftp.php 1 location

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

apps/files_external/lib/smb.php 1 location

@@ 72-74 (lines=3) @@
69
			$this->share = $this->server->getShare(trim($params['share'], '/'));
70
71
			$this->root = isset($params['root']) ? $params['root'] : '/';
72
			if (!$this->root || $this->root[0] != '/') {
73
				$this->root = '/' . $this->root;
74
			}
75
			if (substr($this->root, -1, 1) != '/') {
76
				$this->root .= '/';
77
			}

lib/private/files/storage/dav.php 1 location

@@ 111-113 (lines=3) @@
108
				}
109
			}
110
			$this->root = isset($params['root']) ? $params['root'] : '/';
111
			if (!$this->root || $this->root[0] != '/') {
112
				$this->root = '/' . $this->root;
113
			}
114
			if (substr($this->root, -1, 1) != '/') {
115
				$this->root .= '/';
116
			}