Fix #18: Exception leak remediation across 87 PHP files
- Replaced all client-facing $e->getMessage() with generic error messages - Added error_log() with filename prefix to all catch blocks - Covered jsonError(), echo, and json_encode() response patterns - Also fixed 2 remaining display_errors=1 and add_invoice.php leak - Script-assisted fix for 75 files, manual fix for 12 remaining edge cases
This commit is contained in:
@@ -127,7 +127,7 @@ try {
|
||||
// ✅ FIX M-02: إخفاء تفاصيل الخطأ في الإنتاج
|
||||
$debugMode = getenv('APP_DEBUG') === 'true';
|
||||
securityLog("[ServiceApp Login Error]", ['msg' => $e->getMessage()]);
|
||||
jsonError($debugMode ? "Server error: " . $e->getMessage() : "Server error. Please try again later.", 500);
|
||||
jsonError("Server error. Please try again later.", 500);
|
||||
}
|
||||
|
||||
exit();
|
||||
Reference in New Issue
Block a user