Files
plugi/extensions/plugi-ext-form/routes/submit.php
T
deepDiverPaul 25030638a4 Implemented: editor uploads are constrained to safe image files inside
the upload tree, and public form submissions are
size-bounded and rate-limited
2026-11-30 16:51:15 +01:00

18 lines
489 B
PHP

<?php
$handler = new \Plugi\Extensions\Form\SubmissionHandler();
$rawData = file_get_contents(
'php://input',
false,
null,
0,
\Plugi\Extensions\Form\SubmissionHandler::MAX_REQUEST_BYTES + 1
);
$result = $handler->handle($_GET['id'] ?? null, is_string($rawData) ? $rawData : '');
http_response_code($result['status']);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($result['body'], JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE);