fixed something

This commit is contained in:
Lain Iwakura 2025-06-16 00:48:44 +03:00
parent 8945109728
commit f1a6426e22
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ if (!$input) {
$username = filter_var($input['username'] ?? '', FILTER_SANITIZE_STRING); $username = filter_var($input['username'] ?? '', FILTER_SANITIZE_STRING);
$message = $input['message'] ?? ''; $message = $input['message'] ?? '';
$signature = $input['signature'] ?? ''; $signature = $input['signature'] ?? '';
$is_encrypted = !empty($input['encrypted']); $is_encrypted = !empty($input['encrypted']) ? 1 : 0;
if (!$username || !$message) { if (!$username || !$message) {
http_response_code(400); http_response_code(400);

View File

@ -21,7 +21,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING); $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
$message = filter_input(INPUT_POST, 'message', FILTER_SANITIZE_STRING); $message = filter_input(INPUT_POST, 'message', FILTER_SANITIZE_STRING);
$signature = $_POST['signature'] ?? ''; $signature = $_POST['signature'] ?? '';
$is_encrypted = isset($_POST['encrypted']); $is_encrypted = isset($_POST['encrypted']) ? 1 : 0;
if ($username && $message) { if ($username && $message) {
try { try {