mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
handle error situation of rename proper
This commit is contained in:
parent
5d671a84b2
commit
e55f25b64d
1 changed files with 6 additions and 1 deletions
|
|
@ -88,7 +88,12 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
|
|||
}
|
||||
|
||||
// rename to correct path
|
||||
\OC\Files\Filesystem::rename($partpath, $newPath);
|
||||
$renameOkay = \OC\Files\Filesystem::rename($partpath, $newPath);
|
||||
if (!$renameOkay) {
|
||||
\OC_Log::write('webdav', '\OC\Files\Filesystem::rename() failed', \OC_Log::ERROR);
|
||||
\OC\Files\Filesystem::unlink($partpath);
|
||||
throw new Sabre_DAV_Exception();
|
||||
}
|
||||
|
||||
// allow sync clients to send the mtime along in a header
|
||||
$mtime = OC_Request::hasModificationTime();
|
||||
|
|
|
|||
Loading…
Reference in a new issue