Skip to content
Snippets Groups Projects
Commit 59322a50 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #15333 from owncloud/copy-cross-device

fix copying folder across devices
parents dfc0a26e 068c624b
No related branches found
No related tags found
No related merge requests found
......@@ -228,6 +228,19 @@ if (\OC_Util::runningOnWindows()) {
$this->unlink($path2);
}
if ($this->is_dir($path1)) {
// we cant move folders across devices, use copy instead
$stat1 = stat(dirname($this->getSourcePath($path1)));
$stat2 = stat(dirname($this->getSourcePath($path2)));
if ($stat1['dev'] !== $stat2['dev']) {
$result = $this->copy($path1, $path2);
if ($result) {
$result &= $this->rmdir($path1);
}
return $result;
}
}
return rename($this->getSourcePath($path1), $this->getSourcePath($path2));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment