Update index.php

PUT needs to save the file with decoded filename
This commit is contained in:
lookshe 2016-02-05 14:21:39 +01:00
parent 14cc1291ed
commit 31da8eb9ef

View file

@ -90,7 +90,7 @@ switch ($method) {
if (!checkFilenameParameter($filename, $slotParameters)) { if (!checkFilenameParameter($filename, $slotParameters)) {
sendHttpReturnCodeAndJson(403, "Uploaded filename differs from requested slot filename."); sendHttpReturnCodeAndJson(403, "Uploaded filename differs from requested slot filename.");
} }
$uploadFilePath = getUploadFilePath($slotUUID, $config, $slotParameters['filename']); $uploadFilePath = rawurldecode(getUploadFilePath($slotUUID, $config, $slotParameters['filename']));
if (file_exists($uploadFilePath)) { if (file_exists($uploadFilePath)) {
sendHttpReturnCodeAndJson(403, "The slot was already used."); sendHttpReturnCodeAndJson(403, "The slot was already used.");
} }
@ -250,4 +250,4 @@ function generate_uuid() {
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
); );
} }
?> ?>