v1.0.0.9
Publisium
- <?php
-
- declare(strict_types=1);
-
- require_once __DIR__ . '/includes/config.php';
- require_once __DIR__ . '/includes/database.php';
- require_once __DIR__ . '/includes/user-auth.php';
- require_once __DIR__ . '/includes/site-comments.php';
-
- UserAuth::boot();
-
- if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
- header('Allow: POST');
- http_response_code(405);
- exit;
- }
-
- SiteComments::handleSubmission($_POST);
-
- $returnTo = (string) ($_POST['return_to'] ?? '');
- if (preg_match('#^/(?![/\\\\])[^\s]*$#', $returnTo) !== 1) {
- $returnTo = SiteFront::homeUrl('');
- }
- $returnTo = (string) preg_replace('/#.*$/', '', $returnTo);
-
- header('Location: ' . $returnTo . '#comment-form', true, 303);
- exit;
-