diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2016-05-29 10:41:06 +0200 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2016-05-29 10:48:38 +0200 |
| commit | 18f66c8f9c8586a4aa5dcb38097b13730ec298cf (patch) | |
| tree | cb81bc4b2d187dc6d24faecd07e201dbfafe8da2 /static/classes | |
| parent | e52deaa93064294e6e5ab016c6c02180406497bc (diff) | |
Response: Return 500 Internal Server Error on error()
Fix a bug where Response class `error()` function may blow up and return
an invalid HTTP status code `42` if `PDO::ATTR_ERRMODE` is set to
`PDO::ERRMODE_EXCEPTION` during PDO initialization or query. By default,
it is implicitly set to `PDO::ERRMODE_SILENT`.
This bug can occur when a MySQL server is running, but encounters an
error post-login (e.g. table doesn't exist).
Diffstat (limited to 'static/classes')
| -rwxr-xr-x | static/classes/Response.class.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php index 27dbd74..b563e66 100755 --- a/static/classes/Response.class.php +++ b/static/classes/Response.class.php @@ -78,7 +78,7 @@ class Response break; } - http_response_code($code); + http_response_code(500); // "500 Internal Server Error" echo $response; } |
