summaryrefslogtreecommitdiffstats
path: root/application/controllers/api/v2/file.php
AgeCommit message (Collapse)AuthorFilesLines
2020-10-07API: Add `minimum-id-length` post parameterSimon Schuster1-2/+18
This parameter controls the generated id for files (file/upload) and multipastes (file/create_multipaste). The post parameter has to be a positive integer value >= 2. Changes by Florian Pritz: - minor style and typo fixes - NEWS entry - check expected error reply content in tests Signed-off-by: Florian Pritz <bluewind@xinu.at>
2020-04-19Reclassify various exceptions as UserInputExceptionFlorian Pritz1-1/+1
These are errors that a user can correct themselves so we should classify them accordingly. That way they get the correct HTTP status code and they also get ignored by the logging code. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-18Remove unsupported secondary controllerFlorian Pritz1-15/+15
Having more than one controller per request doesn't work with CI3. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-07-04API: Fix return type of empty values in file/deleteFlorian Pritz1-1/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-07-04Create function for ensuring that json keys contain objectsFlorian Pritz1-5/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-07-04API: Fix return type of empty values in file/historyFlorian Pritz1-0/+7
If the array is not casted to a object, json_encode will encode it as [] if empty, but {} if it contains data. Always return an object by casting the array to an object if it is empty. Fixes #15 Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-05-12Catch incorrect POST parameters (array vs string)Florian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-05Remove API v1 compatability codeFlorian Pritz1-4/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-08-21mfile->add_file: Take userid via argumentFlorian Pritz1-1/+2
This allows for easier testing. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-07-04service\files->get_multipaste_history: Add sort order from DBFlorian Pritz1-1/+5
Keep this field private for now. I may be exposed at a later time. The returned values are already normalized so they can be safely exposed. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-09-14API 2.0: Remove private fields from file/historyFlorian Pritz1-0/+88
Since this is a breaking change bump the api version to 2. The private fields are user_id and multipaste_id which where leaked via the multipaste_items field. This commit also adds a test case to both api versions that checks the returned fields. NOTE: Most of this commit is copied from the files of api v1 so when viewing the diff use --find-copies-harder for an easy to read diff. Signed-off-by: Florian Pritz <bluewind@xinu.at>