]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix creating unique filenames
authorRobin Appelman <icewind@owncloud.com>
Mon, 16 Apr 2012 08:58:40 +0000 (10:58 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 16 Apr 2012 08:58:40 +0000 (10:58 +0200)
lib/helper.php

index 412f0e6b7643377493c8cf5209d9eaba0b4fb9f8..eed94917767417d1e5587bdd3713cfd94e5ed040 100755 (executable)
@@ -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;
     }
 }