Merge pull request #22518 from owncloud/checkdeletebeforecopyinsteadofrename
Check delete permission before attemping copy+delete
This commit is contained in:
commit
fb38625741
|
@ -613,6 +613,10 @@ abstract class Common implements Storage, ILockingStorage {
|
||||||
return $this->rename($sourceInternalPath, $targetInternalPath);
|
return $this->rename($sourceInternalPath, $targetInternalPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$sourceStorage->isDeletable($sourceInternalPath)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, true);
|
$result = $this->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if ($sourceStorage->is_dir($sourceInternalPath)) {
|
if ($sourceStorage->is_dir($sourceInternalPath)) {
|
||||||
|
|
|
@ -459,6 +459,10 @@ class Encryption extends Wrapper {
|
||||||
// - copy the copyKeys() call from $this->copyBetweenStorage to this method
|
// - copy the copyKeys() call from $this->copyBetweenStorage to this method
|
||||||
// - remove $this->copyBetweenStorage
|
// - remove $this->copyBetweenStorage
|
||||||
|
|
||||||
|
if (!$sourceStorage->isDeletable($sourceInternalPath)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true);
|
$result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if ($sourceStorage->is_dir($sourceInternalPath)) {
|
if ($sourceStorage->is_dir($sourceInternalPath)) {
|
||||||
|
|
Loading…
Reference in New Issue