X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fclienterroraction.php;h=7d007a75675775ee35fa67dc89ea79acb2774426;hb=a5ed805aeabab3930d066b2777dbab9663bc487f;hp=ef6fd51dffc16f3dc5b4df82743c9bd460842a06;hpb=fbd1cf4dfa452166a5985d9a9177d57e8554f09f;p=quix0rs-gnu-social.git diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php index ef6fd51dff..7d007a7567 100644 --- a/lib/clienterroraction.php +++ b/lib/clienterroraction.php @@ -6,14 +6,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou - * @author Zach Copley + * @package StatusNet + * @author Evan Prodromou + * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, 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 @@ -29,7 +29,7 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,17 +39,17 @@ require_once INSTALLDIR.'/lib/error.php'; * Class for displaying HTTP client errors * * @category Action - * @package Laconica - * @author Zach Copley + * @package StatusNet + * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ClientErrorAction extends ErrorAction { function __construct($message='Error', $code=400) { parent::__construct($message, $code); - + $this->status = array(400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', @@ -70,9 +70,9 @@ class ClientErrorAction extends ErrorAction 417 => 'Expectation Failed'); $this->default = 400; } - + // XXX: Should these error actions even be invokable via URI? - + function handle($args) { parent::handle($args); @@ -84,11 +84,16 @@ class ClientErrorAction extends ErrorAction } $this->message = $this->trimmed('message'); - + if (!$this->message) { - $this->message = "Client Error $this->code"; - } + $this->message = "Client Error $this->code"; + } $this->showPage(); } + + function title() + { + return $this->status[$this->code]; + } }