From 43ac43d7af95df2c4ef8002f9f0556ebc72ae3b0 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Wed, 24 Oct 2012 17:31:22 +0200
Subject: [PATCH] dir in newfile has to start with /

---
 apps/files/ajax/newfile.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index 77d866979c3..b87079f2712 100644
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -9,7 +9,7 @@ if(!OC_User::isLoggedIn()) {
 
 session_write_close();
 // Get the params
-$dir = isset( $_REQUEST['dir'] ) ? trim($_REQUEST['dir'], '/\\') : '';
+$dir = isset( $_REQUEST['dir'] ) ? '/'.trim($_REQUEST['dir'], '/\\') : '';
 $filename = isset( $_REQUEST['filename'] ) ? trim($_REQUEST['filename'], '/\\') : '';
 $content = isset( $_REQUEST['content'] ) ? $_REQUEST['content'] : '';
 $source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : '';
-- 
GitLab