From 464c751f30cb65702592f43c0836e343cfe4b40c Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Mon, 16 Apr 2012 10:58:40 +0200
Subject: [PATCH] fix creating unique filenames

---
 lib/helper.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/helper.php b/lib/helper.php
index 412f0e6b764..eed94917767 100755
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -502,6 +502,9 @@ class OC_Helper {
      */
     public static function buildNotExistingFileName($path, $filename)
     {
+	    if($path==='/'){
+		    $path='';
+	    }
         if ($pos = strrpos($filename, '.')) {
             $name = substr($filename, 0, $pos);
             $ext = substr($filename, $pos);
@@ -518,6 +521,6 @@ class OC_Helper {
             $counter++;
         }
 
-        return $newname;
+        return $newpath;
     }
 }
-- 
GitLab