Closed whitsey closed 4 years ago
My bad. Please delete. After writing I followed the steps and found the problem.
pCloud\File.php:113:
if (!is_int($fileId)) {
throw new InvalidArgumentException("Invalid file id");
}
I stripped and filtered POST and it is now an int.
Testing uploading and deleting a file
I uploaded a file:
Then I passed the fileid to the delete.php and tried to call delete():
Result:
Fatal error: Uncaught InvalidArgumentException: Invalid file id in pCloud\File.php on line 113
Stack Trace:delete.php:31
Which is this line:
$fileMetadata = $pcloudFile->delete($_POST["fileid"]);
I have validated that in
delete.php
the$_POST["fileid"]
is exactly the same as what is returned inupload.php
in$fileMetadata->metadata->fileid
It's throwing a Fatal Error and not even a passing an error in the return array.