diff --git a/apps/dav/appinfo/Migrations/Version20170607100912.php b/apps/dav/appinfo/Migrations/Version20170607100912.php new file mode 100644 index 000000000000..740cda6418d0 --- /dev/null +++ b/apps/dav/appinfo/Migrations/Version20170607100912.php @@ -0,0 +1,22 @@ +getTable("${prefix}filecache"); + foreach ( ['mtime','storage_mtime'] as $column ) { + if ($table->getColumn($column)->getType()->getName() === Type::INTEGER) { + $table->getColumn($column)->setType(Type::getType(Type::BIGINT)); + } + } + } +} diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml index 5da36c361a92..85736ae04895 100644 --- a/apps/dav/appinfo/info.xml +++ b/apps/dav/appinfo/info.xml @@ -5,7 +5,7 @@ ownCloud WebDAV endpoint AGPL owncloud.org - 0.3.0 + 0.3.1 true diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index b665cb3273d0..a34760d6004e 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -399,6 +399,22 @@ public function legalMtimeProvider() { 'HTTP_X_OC_MTIME' => -34.43, 'expected result' => -34 ], + "long int" => [ + 'HTTP_X_OC_MTIME' => PHP_INT_MAX, + 'expected result' => PHP_INT_MAX + ], + "too long int" => [ + 'HTTP_X_OC_MTIME' => PHP_INT_MAX + 1, + 'expected result' => PHP_INT_MAX + ], + "long negative int" => [ + 'HTTP_X_OC_MTIME' => PHP_INT_MAX * - 1, + 'expected result' => (PHP_INT_MAX * - 1) + ], + "too long negative int" => [ + 'HTTP_X_OC_MTIME' => (PHP_INT_MAX * - 1) - 1, + 'expected result' => (PHP_INT_MAX * - 1) + ], ]; }