X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fclienterroraction.php;h=5c4ef37d18674893704e9ae933952e810875309a;hb=feb97cfc2288169fbf8f1f47393c9735c017eeb6;hp=1b98a1064570d6472bfc2c553925be5d15efb3a8;hpb=5bab0288afe90996729101df1372071e1bf2cffc;p=quix0rs-gnu-social.git diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php index 1b98a10645..5c4ef37d18 100644 --- a/lib/clienterroraction.php +++ b/lib/clienterroraction.php @@ -1,5 +1,4 @@ . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR.'/lib/error.php'; +if (!defined('GNUSOCIAL')) { exit(1); } /** * Class for displaying HTTP client errors @@ -69,26 +64,34 @@ class ClientErrorAction extends ErrorAction { parent::__construct($message, $code); $this->default = 400; - } - - // XXX: Should these error actions even be invokable via URI? - - function handle($args) - { - parent::handle($args); - - $this->code = $this->trimmed('code'); - if (!$this->code || $code < 400 || $code > 499) { + if (!$this->code || $this->code < 400 || $this->code > 499) { $this->code = $this->default; } - - $this->message = $this->trimmed('message'); - if (!$this->message) { $this->message = "Client Error $this->code"; } + } + + /** + * To specify additional HTTP headers for the action + * + * @return void + */ + function extraHeaders() + { + $status_string = @self::$status[$this->code]; + header('HTTP/1.1 '.$this->code.' '.$status_string); + } - $this->showPage(); + /** + * Page title. + * + * @return page title + */ + + function title() + { + return @self::$status[$this->code]; } }