Skip to content

Commit

Permalink
Gave both Error and NotFound the correct status codes according to ht…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dykam committed May 5, 2010
1 parent f2be59d commit 15d49eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions applications/garden/controllers/home.php
Expand Up @@ -39,6 +39,7 @@ public function Index() {
* is encountered.
*/
public function FileNotFound() {
header('Content-Type: text/html; charset=utf-8', true, 404);
$this->Render();
}

Expand Down
2 changes: 1 addition & 1 deletion library/core/functions.error.php
Expand Up @@ -26,7 +26,7 @@ function ErrorHandler($ErrorNumber, $Message, $File, $Line, $Arguments) {

// Clean the output buffer in case an error was encountered in-page.
@ob_end_clean();
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/html; charset=utf-8', true, 500);

$SenderMessage = $Message;
$SenderObject = 'PHP';
Expand Down

2 comments on commit 15d49eb

@vanillaforums
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change before I grab this is to use Garden's configured charset:
charset='.Gdn::Config('Garden.Charset', '')

@Dykam
Copy link
Owner Author

@Dykam Dykam commented on 15d49eb May 6, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean I should apply this first? On a sidenote, row 29 of functions.error.php didn't have it either.

Please sign in to comment.