fix: PHP syntax errors in upload files and composer config

- Fix PHP 8.x string interpolation syntax in upload log calls
- Fix const getenv() -> runtime variable in uploadSyrianDocs.php
- Add composer security advisory ignore for firebase/php-jwt
- Run composer update to sync lock file
This commit is contained in:
Hamza-Ayed
2026-06-17 08:41:16 +03:00
parent 2c56d2f41e
commit 264e005a7b
7 changed files with 152 additions and 70 deletions

View File

@@ -9,7 +9,7 @@ require_once __DIR__ . '/../../connect.php'; // يجب أن يوفّر: $con (ا
const MAX_FILE_MB = 5;
const ALLOWED_MIMES = ['image/jpeg','image/png','image/webp']; // فقط صور
const UPLOAD_ROOT = __DIR__ . "/../../private_uploads"; // مجلد خاص (غير عام)
const SIGN_SECRET = getenv('SECRET_KEY_HMAC'); // غيّرها واقرأها من .env
$SIGN_SECRET = getenv('SECRET_KEY_HMAC') ?: ''; // غيّرها واقرأها من .env
$host = getenv('APP_DOMAIN') ?: 'api-syria.siromove.com';
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http";
define('PUBLIC_BASE', "$protocol://$host/siro");
@@ -54,7 +54,7 @@ if (!in_array($docType, $allowedDocTypes, true)) {
// --------- التحقق من الملف ---------
if (isset($_FILES['file'])) {
uploadLog("$_FILES['file'] metadata", 'INFO', [
uploadLog('$_FILES[\'file\'] metadata', 'INFO', [
'name' => $_FILES['file']['name'] ?? 'unknown',
'type' => $_FILES['file']['type'] ?? 'unknown',
'size' => $_FILES['file']['size'] ?? 0,