Upload via GUI (396 Dateien)

This commit is contained in:
2026-11-04 07:55:51 +00:00
parent d1aae0f2ce
commit fad8536292
5 changed files with 17 additions and 6 deletions
+4 -1
View File
@@ -47,7 +47,10 @@ if (!$apiKey) {
if ($method === 'POST') {
if (!$apiKey['can_create_tickets']) public_api_fail(403, 'FORBIDDEN', 'Dieser Schlüssel darf keine Tickets anlegen.');
$raw = file_get_contents('php://input') ?: '';
if (strlen($raw) > 200000) public_api_fail(413, 'TOO_LARGE', 'Die Anfrage ist zu groß.');
// Normale Anfragen höchstens 200 KB; mit Dateianhängen (Base64) mehr: bis zu 10 MB Dateien, Base64 macht rund ein Drittel mehr daraus
if (strlen($raw) > 200000 && (strlen($raw) > 200000 + (int) (PUBLIC_ATTACHMENT_TOTAL_BYTES * 1.4) || !str_contains($raw, '"attachments"'))) {
public_api_fail(413, 'TOO_LARGE', 'Die Anfrage ist zu groß.');
}
$body = json_decode($raw, true);
if (!is_array($body)) public_api_fail(400, 'INVALID_JSON', 'Der Anfragekörper muss gültiges JSON sein.');
if (($body['action'] ?? '') === 'resolve') {