aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Error.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-18 11:47:16 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-18 11:47:16 +0100
commitd91a92434f516a9e25bf0dca608a0221094d0489 (patch)
treef1655a199a38cb18b83d4b57a3d6c75ff5c78d05 /lib/Minz/Error.php
parentfa2254cd313f538d74850a67bc062f24626d009d (diff)
Fix Minz_Error and error_Controller
- Error code and logs was not propagated from Minz_Error to the controller - header was bad (200 instead of 404 or 403) Related to https://github.com/FreshRSS/FreshRSS/issues/751
Diffstat (limited to 'lib/Minz/Error.php')
-rw-r--r--lib/Minz/Error.php39
1 files changed, 5 insertions, 34 deletions
diff --git a/lib/Minz/Error.php b/lib/Minz/Error.php
index 3eadc6d98..3e4a3e8f3 100644
--- a/lib/Minz/Error.php
+++ b/lib/Minz/Error.php
@@ -23,42 +23,13 @@ class Minz_Error {
$logs = self::processLogs ($logs);
$error_filename = APP_PATH . '/Controllers/errorController.php';
- switch ($code) {
- case 200 :
- header('HTTP/1.1 200 OK');
- break;
- case 403 :
- header('HTTP/1.1 403 Forbidden');
- break;
- case 404 :
- header('HTTP/1.1 404 Not Found');
- break;
- case 500 :
- header('HTTP/1.1 500 Internal Server Error');
- break;
- case 503 :
- header('HTTP/1.1 503 Service Unavailable');
- break;
- default :
- header('HTTP/1.1 500 Internal Server Error');
- }
-
if (file_exists ($error_filename)) {
- $params = array (
- 'code' => $code,
- 'logs' => $logs
- );
+ Minz_Session::_param('error_code', $code);
+ Minz_Session::_param('error_logs', $logs);
- if ($redirect) {
- Minz_Request::forward (array (
- 'c' => 'error'
- ), true);
- } else {
- Minz_Request::forward (array (
- 'c' => 'error',
- 'params' => $params
- ), false);
- }
+ Minz_Request::forward (array (
+ 'c' => 'error'
+ ), $redirect);
} else {
echo '<h1>An error occured</h1>' . "\n";