Page MenuHomeGitPull.it

No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/include/class-BadRequest.php b/include/class-BadRequest.php
index e497db6..c1a0f1d 100644
--- a/include/class-BadRequest.php
+++ b/include/class-BadRequest.php
@@ -1,32 +1,44 @@
<?php
-# Copyright (C) 2018 Valerio Bozzolan
+# Copyright (C) 2018, 2019 Valerio Bozzolan
# Boz Libre Hosting Panel
#
# 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 the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
class BadRequest {
- public static function spawn( $message = null ) {
- http_response_code( 400 );
+ /**
+ * Spawn a bad request message
+ *
+ * @param string $message
+ * @param int $code HTTP status code
+ */
+ public static function spawn( $message = null, $code = 400 ) {
+
+ http_response_code( $code );
+
Header::spawn( [
+ 'uid' => false,
'title' => __( "Bad request" )
] );
+
template( 'bad-request', [
'message' => $message,
] );
+
Footer::spawn();
+
exit;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Nov 19, 09:44 (27 m, 58 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2265652
Default Alt Text
(1 KB)

Event Timeline