Update: 2026-08-03 13:37:04

This commit is contained in:
Hamza-Ayed
2026-08-03 13:37:04 +03:00
parent 79333a4bee
commit dbf1e7870f
3 changed files with 31 additions and 8 deletions
+9 -1
View File
@@ -10,7 +10,15 @@ if ($role !== 'admin' && $role !== 'super_admin') {
exit;
}
$driverId = filterRequest("id");
// filterRequest() تقرأ من POST أو JSON body فقط ولا تلمس $_GET
// (core/helpers.php). شاشة مراجعة الوثائق تنادي هذه النقطة بـ
// ?id=... في الـ query string، فكانت تُرجع "driver_id is required"
// دائماً رغم إرسال المعرّف. نقبل الشكلين، ونقبل driver_id أيضاً
// لأن رسالة الخطأ نفسها تسمّيه هكذا.
$driverId = filterRequest("id")
?: filterRequest("driver_id")
?: (isset($_GET['id']) ? trim((string) $_GET['id']) : null)
?: (isset($_GET['driver_id']) ? trim((string) $_GET['driver_id']) : null);
if (empty($driverId)) {
jsonError("driver_id is required.");
+7
View File
@@ -44,6 +44,12 @@ if (!$key) {
$iv = getenv('initializationVector'); // 16 bytes
// ‏الصنف نفسه معرَّف أيضاً في core/Security/EncryptionHelper.php، وأي ملف
// ‏يحمّل bootstrap.php ثم يصل إلى هنا كان ينهار بـ "Cannot declare class
// ‏EncryptionHelper, because the name is already in use" — وهو ما أسقط
// ‏blacklist_manager.php. نُبقي أول تعريف محمَّل (النسخة الحديثة في core)
// ‏ونتخطّى هذه النسخة القديمة المتروكة للتوافقية.
if (!class_exists('EncryptionHelper', false)) {
class EncryptionHelper {
private $key;
private $iv;
@@ -160,6 +166,7 @@ class EncryptionHelper {
return $decrypted;
}
}
} // نهاية حارس class_exists
// ✅ Load the key and IV from .env or use default values
// ✅ Ensure the lengths are correct