diff options
author | CiaranG <ciaran@ciarang.com> | 2009-03-05 16:18:59 +0000 |
---|---|---|
committer | CiaranG <ciaran@ciarang.com> | 2009-03-05 16:18:59 +0000 |
commit | 3c53e821cc545d14807c9197d07e8686028a846d (patch) | |
tree | e51f35dc8783ea2ba3c9443d28a55a707330909a /lib/servererroraction.php | |
parent | e5345d8d7a5b519cfb24c9e2a971b485b3c1c872 (diff) | |
parent | ea0c5f565c9ca4b34c1071a51333f0f842a954b9 (diff) |
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'lib/servererroraction.php')
-rw-r--r-- | lib/servererroraction.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/servererroraction.php b/lib/servererroraction.php index 80a3fdd7b..595dcf147 100644 --- a/lib/servererroraction.php +++ b/lib/servererroraction.php @@ -42,7 +42,7 @@ require_once INSTALLDIR.'/lib/error.php'; * says that 500 errors should be treated similarly to 400 errors, and * it's easier to give an HTML response. Maybe we can customize these * to display some funny animal cartoons. If not, we can probably role - * these classes up into a single class. + * these classes up into a single class. * * See: http://tools.ietf.org/html/rfc2616#section-10 * @@ -57,19 +57,19 @@ class ServerErrorAction extends ErrorAction function __construct($message='Error', $code=500) { parent::__construct($message, $code); - + $this->status = array(500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported'); - + $this->default = 500; } // XXX: Should these error actions even be invokable via URI? - + function handle($args) { parent::handle($args); @@ -81,12 +81,16 @@ class ServerErrorAction extends ErrorAction } $this->message = $this->trimmed('message'); - + if (!$this->message) { - $this->message = "Server Error $this->code"; - } + $this->message = "Server Error $this->code"; + } $this->showPage(); } - + + function title() + { + return $this->status[$this->code]; + } } |