]> source.dussan.org Git - nextcloud-server.git/commitdiff
use normalizePath to have a proper target path
authorArthur Schiwon <blizzz@owncloud.com>
Mon, 26 Nov 2012 13:13:23 +0000 (14:13 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 26 Nov 2012 13:35:13 +0000 (14:35 +0100)
apps/files/ajax/newfile.php

index 411654af606bce47950b3319f601e4e3ed6e6db8..2bac9bb20ba12829211e7f1d1618157fe4cb40b4 100644 (file)
@@ -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);