X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fclienterroraction.php;h=cd7d85221ef231f904bc88ebb71b692634a76730;hb=ae883ceb9b4689f6c1dd3aecdc4a844eda7d179a;hp=ef6fd51dffc16f3dc5b4df82743c9bd460842a06;hpb=171d89aab79207f08b3c84d76a4b2bb50185490d;p=quix0rs-gnu-social.git diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php index ef6fd51dff..cd7d85221e 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 @@ -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]; + } }