X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fservererroraction.php;h=db735216685848daf9b436b8104a47c06e811dfe;hb=4d05afae302f1870af369a713ab7ed291c821165;hp=80a3fdd7b408f39b487bc80282f1a684f1c3f5bd;hpb=ab16bb876b895c16f3a7da8eb658e68dc9a9eb24;p=quix0rs-gnu-social.git diff --git a/lib/servererroraction.php b/lib/servererroraction.php index 80a3fdd7b4..db73521668 100644 --- a/lib/servererroraction.php +++ b/lib/servererroraction.php @@ -13,7 +13,7 @@ * @link http://laconi.ca/ * * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. + * Copyright (C) 2008, 2009, Control Yourself, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -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]; + } }