Update: 2026-06-27 05:36:53
This commit is contained in:
@@ -48,10 +48,11 @@ try {
|
||||
uploadLog("✅ File moved successfully to: " . $uploadResult['path']);
|
||||
|
||||
// 3. تحديث قاعدة البيانات ديناميكياً
|
||||
// Use configured domain instead of Host header to prevent host header injection
|
||||
$host = getenv('APP_DOMAIN') ?: 'api.siromove.com';
|
||||
$protocol = 'https';
|
||||
$linkImage = "$protocol://$host/siro/portrate_captain_image/" . $new_filename;
|
||||
// Derive base URL dynamically from the actual request
|
||||
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
||||
$host = getenv('APP_DOMAIN') ?: ($_SERVER['HTTP_HOST'] ?? 'api.siromove.com');
|
||||
$scriptDir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/');
|
||||
$linkImage = "$protocol://$host$scriptDir/portrate_captain_image/" . $new_filename;
|
||||
|
||||
// تأكد من أن الاتصال قادم من connect.php أو اجلبه
|
||||
$con = Database::get('main');
|
||||
|
||||
Reference in New Issue
Block a user