diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index d735cf8626a281c4b47df464832aa2d5be6ebb1f..2b51131b20be0b9f5dc262b975fc6c0f4e7ed2bf 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -595,14 +595,14 @@ class Filesystem {
 		if ($path[0] !== '/') {
 			$path = '/' . $path;
 		}
-//remove trailing slash
-		if ($stripTrailingSlash and strlen($path) > 1 and substr($path, -1, 1) === '/') {
-			$path = substr($path, 0, -1);
-		}
 //remove duplicate slashes
 		while (strpos($path, '//') !== false) {
 			$path = str_replace('//', '/', $path);
 		}
+//remove trailing slash
+		if ($stripTrailingSlash and strlen($path) > 1 and substr($path, -1, 1) === '/') {
+			$path = substr($path, 0, -1);
+		}
 //normalize unicode if possible
 		if (class_exists('Normalizer')) {
 			$path = \Normalizer::normalize($path);
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 6e7608f596bb618ed1a5a5b17185b30c3903fd85..adbed5a18b6236f9c56de57f0f8eb9ba8476f431 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -69,6 +69,9 @@ class View extends \PHPUnit_Framework_TestCase {
 		$this->assertEquals($imageSize, $folderData[1]['size']);
 		$this->assertEquals($textSize, $folderData[2]['size']);
 		$this->assertEquals($storageSize, $folderData[3]['size']);
+
+		$folderView = new \OC\Files\View('/folder');
+		$this->assertEquals($rootView->getFileInfo('/folder'), $folderView->getFileInfo('/'));
 	}
 
 	public function testAutoScan() {