From 74cf3b5dfb4c56074672850230ddb97cbb07675b Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@owncloud.com>
Date: Mon, 26 Nov 2012 14:13:23 +0100
Subject: [PATCH] use normalizePath to have a proper target path

---
 apps/files/ajax/newfile.php | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index 411654af606..2bac9bb20ba 100644
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -65,9 +65,7 @@ if($source) {
 	$target=$dir.'/'.$filename;
 	$result=OC_Filesystem::file_put_contents($target, $sourceStream);
 	if($result) {
-		if($target[0] != '/') {
-			$target = '/'.$target;
-		}
+		$target = OC_Filesystem::normalizePath($target);
 		$meta = OC_FileCache::get($target);
 		$mime=$meta['mimetype'];
 		$id = OC_FileCache::getId($target);
-- 
GitLab