Code Duplication    Length = 11-12 lines in 2 locations

lib/private/Files/ObjectStore/ObjectStoreStorage.php 1 location

@@ 120-131 (lines=12) @@
117
	 * @param string $path
118
	 * @return string
119
	 */
120
	private function normalizePath($path) {
121
		$path = trim($path, '/');
122
		//FIXME why do we sometimes get a path like 'files//username'?
123
		$path = str_replace('//', '/', $path);
124
125
		// dirname('/folder') returns '.' but internally (in the cache) we store the root as ''
126
		if (!$path || $path === '.') {
127
			$path = '';
128
		}
129
130
		return $path;
131
	}
132
133
	/**
134
	 * Object Stores use a NoopScanner because metadata is directly stored in

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

@@ 93-103 (lines=11) @@
90
	/**
91
	 * @param string $path
92
	 */
93
	private function normalizePath($path) {
94
		$path = trim($path, '/');
95
96
		if (!$path) {
97
			$path = '.';
98
		}
99
100
		$path = str_replace('#', '%23', $path);
101
102
		return $path;
103
	}
104
105
	const SUBCONTAINER_FILE = '.subcontainers';
106