]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/clienterroraction.php
[CORE] Bump Database requirement to MariaDB 10.3+
[quix0rs-gnu-social.git] / lib / clienterroraction.php
index 08bced5bdada3ee288fb18d5472c9555f3016c9c..5c4ef37d18674893704e9ae933952e810875309a 100644 (file)
@@ -12,7 +12,7 @@
  * @link     http://status.net/
  *
  * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, StatusNet, Inc.
+ * Copyright (C) 2008-2010 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
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/error.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Class for displaying HTTP client errors
@@ -68,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";
         }
+    }
 
-        $this->showPage();
+    /**
+     *  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);
+    }
+
+    /**
+     * Page title.
+     *
+     * @return page title
+     */
+
+    function title()
+    {
+        return @self::$status[$this->code];
     }
 }