File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,9 @@ public static function redirect($destination)
3232 }
3333 }
3434
35- public static function headerResponseCode (int $ code )
35+ public static function headerResponseCode (int $ code, string $ reason )
3636 {
37- $ responseCodeMessage = @http_response_code ($ code ) ?? "" ;
38- $ msg = $ _SERVER ["SERVER_PROTOCOL " ] . " " . strval ($ code ) . " " . $ responseCodeMessage ;
37+ $ msg = $ _SERVER ["SERVER_PROTOCOL " ] . " " . strval ($ code ) . " " . $ reason ;
3938 header ($ msg , true , $ code );
4039 }
4140
@@ -56,14 +55,14 @@ public static function errorLog(string $title, string $message)
5655
5756 public static function badRequest ($ message )
5857 {
59- self ::headerResponseCode (400 );
58+ self ::headerResponseCode (400 , " bad request " );
6059 self ::errorLog ("bad request " , $ message );
6160 self ::die ();
6261 }
6362
6463 public static function forbidden ($ message )
6564 {
66- self ::headerResponseCode (403 );
65+ self ::headerResponseCode (403 , " forbidden " );
6766 self ::errorLog ("forbidden " , $ message );
6867 self ::die ();
6968 }
You can’t perform that action at this time.
0 commit comments