Code Duplication    Length = 6-10 lines in 2 locations

lib/private/Files/Storage/Wrapper/Jail.php 1 location

@@ 66-71 (lines=6) @@
63
	public function getJailedPath($path) {
64
		$root = rtrim($this->rootPath, '/') . '/';
65
66
		if (strpos($path, $root) !== 0) {
67
			return null;
68
		} else {
69
			$path = substr($path, strlen($this->rootPath));
70
			return trim($path, '/');
71
		}
72
	}
73
74
	public function getId() {

lib/private/Files/View.php 1 location

@@ 177-186 (lines=10) @@
174
		// missing slashes can cause wrong matches!
175
		$root = rtrim($this->fakeRoot, '/') . '/';
176
177
		if (strpos($path, $root) !== 0) {
178
			return null;
179
		} else {
180
			$path = substr($path, strlen($this->fakeRoot));
181
			if (strlen($path) === 0) {
182
				return '/';
183
			} else {
184
				return $path;
185
			}
186
		}
187
	}
188
189
	/**