summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-28 01:08:52 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-28 01:08:52 +0100
commit2a7b1bae10f9578485805d3733eda21b019236c1 (patch)
tree289adce61e231af0be91a2cbd28d22ced607c4c5 /apps/dav/tests
parentffe034abb09b5f73ec50f15c7deb92357765377f (diff)
downloadnextcloud-server-2a7b1bae10f9578485805d3733eda21b019236c1.tar.gz
nextcloud-server-2a7b1bae10f9578485805d3733eda21b019236c1.zip
Reject X-OC-MTime header if given as a string with hexadecimal notation
In PHP 7.X hexadecimal notation support was removed from "is_numeric", so "sanitizeMtime" directly rejected those values; in PHP 5.X, on the other hand, "sanitizeMtime" returned 0 when a string with hexadecimal notation was given (as it was the behaviour of "intval"). To provide a consistent behaviour between PHP versions, and given that it does not make much sense to send X-OC-MTime in hexadecimal notation, now X-OC-MTime is always rejected if given as a string with hexadecimal notation. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FileTest.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
index 2bc65b987b7..1db9b7948e3 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
@@ -370,7 +370,7 @@ class FileTest extends \Test\TestCase {
],
"string castable hex int" => [
'HTTP_X_OC_MTIME' => "0x45adf",
- 'expected result' => 0
+ 'expected result' => null
],
"string that looks like invalid hex int" => [
'HTTP_X_OC_MTIME' => "0x123g",