mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-18 04:31:06 +01:00
fix CalDAVTester failure: managed-attachments: Simple non-recurring, non-scheduled update attachment: Test 4: rename of attachment via Content-Disposition:filename=
This commit is contained in:
parent
7ed6c0b3f1
commit
20ede24957
@ -1304,6 +1304,19 @@ class groupdav extends HTTP_WebDAV_Server
|
||||
}
|
||||
else
|
||||
{
|
||||
// check for rename of attachment via Content-Disposition:filename=
|
||||
if (isset($this->_SERVER['HTTP_CONTENT_DISPOSITION']) &&
|
||||
substr($this->_SERVER['HTTP_CONTENT_DISPOSITION'], 0, 10) === 'attachment' &&
|
||||
preg_match('/filename="?([^";]+)/', $this->_SERVER['HTTP_CONTENT_DISPOSITION'], $matches) &&
|
||||
($filename = egw_vfs::basename($matches[1])) != egw_vfs::basename($path))
|
||||
{
|
||||
$old_path = $path;
|
||||
if (!egw_vfs::rename($old_path, $path = egw_vfs::concat(egw_vfs::dirname($path), $filename)))
|
||||
{
|
||||
self::xml_error(self::mkprop(self::CALDAV, 'valid-managed-id-parameter', ''));
|
||||
return '403 Forbidden';
|
||||
}
|
||||
}
|
||||
if (!($to = egw_vfs::fopen($path, 'w')) ||
|
||||
isset($options['stream']) && ($copied=stream_copy_to_stream($options['stream'], $to)) === false ||
|
||||
isset($options['content']) && ($copied=fwrite($to, $options['content'])) === false)
|
||||
|
Loading…
Reference in New Issue
Block a user