Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Final fixes for errors. Controller::triggerHardError() no longer caus…

…es weird loops.
  • Loading branch information...
commit 037b0363b14fcd7d78cc2298a302cbe415577a83 1 parent 632164d
@mattsah mattsah authored
Showing with 15 additions and 4 deletions.
  1. +15 −4 includes/lib/Controller.php
View
19 includes/lib/Controller.php
@@ -906,18 +906,29 @@ static protected function triggerHardError($error, $message)
'title' => $title
);
- switch (self::acceptTypes()) {
+ $accept_types = self::getRequestFormat()
+ ? self::getFormatTypes(self::getRequestFormat())
+ : array();
+
+ switch (fRequest::getBestAcceptType($accept_types)) {
case 'text/html':
- $view = View::create('html.php', $data)->digest('contents', $message);
+ $view = View::create('html.php', $data)
+ ->digest('contents', $message);
break;
case 'application/json':
- $view = fJSON::encode(array_merge($data, array('contents' => $message)));
+ $view = fJSON::encode(array_merge(
+ $data,
+ array('contents' => $message)
+ ));
break;
case 'application/xml':
- $view = fXML::encode(array_merge($data, array('contents' => $message)));
+ $view = fXML::encode(array_merge(
+ $data, array('contents' => $message)
+ ));
break;
default:
$view = $message;
+ break;
}
View::attach($view);
Please sign in to comment.
Something went wrong with that request. Please try again.