summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorStefan Schneider <stefan.schneider@squareweave.com.au>2017-03-10 16:45:02 +1100
committerStefan Schneider <stefan.schneider@squareweave.com.au>2017-03-10 18:16:27 +1100
commitf6ef024159b66a47109a83a4c98ba59c4bda9aaf (patch)
tree1b970d4e811f1f897f7fe8919a3b4b50b0608b93 /apps/dav
parentc38f87e799c93942c79dfe972b74fa3c2860793d (diff)
downloadnextcloud-server-f6ef024159b66a47109a83a4c98ba59c4bda9aaf.tar.gz
nextcloud-server-f6ef024159b66a47109a83a4c98ba59c4bda9aaf.zip
Correct incorrectly typed X-OC-Mtime header
Signed-off-by: Stefan Schneider <stefan.schneider@squareweave.com.au>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index d0826ee5a8c..391d42393f5 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -206,7 +206,12 @@ class File extends Node implements IFile {
// allow sync clients to send the mtime along in a header
$request = \OC::$server->getRequest();
if (isset($request->server['HTTP_X_OC_MTIME'])) {
- if ($this->fileView->touch($this->path, $request->server['HTTP_X_OC_MTIME'])) {
+ $mtimeStr = $request->server['HTTP_X_OC_MTIME'];
+ if (!is_numeric($mtimeStr)) {
+ throw new \InvalidArgumentException('X-OC-Mtime header must be an integer (unix timestamp).');
+ }
+ $mtime = intval($mtimeStr);
+ if ($this->fileView->touch($this->path, $mtime)) {
header('X-OC-MTime: accepted');
}
}