summaryrefslogtreecommitdiffstats
path: root/application/controllers
AgeCommit message (Collapse)AuthorFilesLines
2020-10-07API: Update API version to 2.2.0Florian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2020-10-07API: Only consider public methods as API endpointsFlorian Pritz1-1/+1
We are not only interested in checking if a method exists here, but really also if it can be called (e.g. if it is public). Private methods should not be considered as potential API endpoints. Before this, private methods could be called, leading to a 500 error due to a call to the private method. Signed-off-by: Florian Pritz <bluewind@xinu.at>
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 Pritz3-12/+12
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>
2020-02-09Fix error when repasting non-existent IDFlorian Pritz1-4/+5
We shouldn't treat a possibly boolean value as an array (`$filedata["data_id"]`). Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-27upload_history_thumbnails: Remove broken PDF thumbnailsFlorian Pritz1-1/+0
PDF thumbnail support has been removed by 98f7c65dddf0667f1a0462e08be9e6273ce658fb, but this has been left. The thumbnails are not generated so the images show up empty. Fix it by simply not listing them in the first place. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-05-21Allow data URLs in CSP headerFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-24Move JSON code to API classFlorian Pritz1-3/+30
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-24Move etag handling to Main classFlorian Pritz1-4/+26
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-24Remove unused length field when passing upload history to viewFlorian Pritz1-4/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-24Remove unused get_max_size endpointFlorian Pritz1-7/+0
This should be have been removed in v2.0.0 with the removal of the plain text API. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-06-14Add cli user deletionFlorian Pritz1-0/+18
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-06-01file/cron: Fix call to undefined method clean_multipaste_tarballsFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-18Add invitation key deletionFlorian Pritz1-0/+12
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-18Extract invitation key creation to \service\userFlorian Pritz1-19/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-03Move cleanup code from controller to \service\filesFlorian Pritz1-95/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-03file/clean_stale_files: Refactor into multiple methodsFlorian Pritz1-2/+10
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-03file/clean_stale_files: Remove multipaste tarballsFlorian Pritz1-2/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-03file/clean_stale_files: Remove database entries without filesFlorian Pritz1-0/+19
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-03file/cron: Refactor multipaste tarball clean code into new methodFlorian Pritz1-17/+22
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-01-31Proper display of expiration duration for less than a dayHrvoje Hodak1-1/+1
2017-12-20Prevent asciinema from being affected by file size limitFlorian Pritz1-8/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-10-16Fix database upgrade success messageFlorian Pritz1-3/+2
The function actually returns something that's not an int. Exceptions are caught so at this point it's fine to just output without a check. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-21Remove usage of deprecated is_cli_request()Florian Pritz2-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-21Fix return checks for CI3Florian Pritz1-3/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-21Close session in long running methodsFlorian Pritz1-0/+2
These do not write to the session but may run for some time. There is no need to keep the session locked while they perform their work. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-21Fix detection of URL ending in slashFlorian Pritz1-1/+1
CI trims tailing slashes from the URL and this should work just fine too. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-18Migrate return code checks for CI3Florian Pritz4-13/+13
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-18Remove secondary controller for CLI usage outputFlorian Pritz2-13/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-18Remove unsupported secondary controllerFlorian Pritz3-31/+35
Having more than one controller per request doesn't work with CI3. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-16Update negativ return check of session userdata for CI3Florian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-09WIP: CI3 migrationFlorian Pritz5-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-09-09Merge tag '3.1.5' into dev-ci3Florian Pritz1-1/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-08-15tools/update_database: Output status after upgradeFlorian Pritz1-1/+10
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-07-11Actually update filesize with update_file_metadatahashworks1-1/+4
According to `application/controllers/tools.php#L32` the `update_file_metadata` tool should update the mimetype AND the filesize, but the latter never got implemented.
2017-07-04API: Update version to 2.1.1Florian Pritz1-1/+1
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 Pritz3-10/+10
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-04-18Use === for some equality checksFlorian Pritz1-3/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-03-26s/renderer: Pass output_cache in constructorFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-03-26Extract render code into dedicated classFlorian Pritz1-144/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-03-24Improve error handling in json reformaterFlorian Pritz1-4/+17
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-03-22Reformat single-line JSON when renderingFlorian Pritz1-0/+5
Be conservative and only apply the reformating for single line pastes. This should cover the most common cases and protect against trying to reformat non-json content. Fixes #14 Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-03-22Pass file content to lexer via stdinFlorian Pritz1-2/+5
This allows to easily modify the content before rendering it. 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-11-05API: Drop v1Florian Pritz3-182/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-05api/user/create_apikey: Directly log in with username/pwFlorian Pritz1-0/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-05Remove cli client upload handlerFlorian Pritz1-52/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>