1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-09 18:16:36 +02:00

exception: Use built-in HTTP response codes

PHP >= 5.4 provides a built-in function to generate valid HTTP
error header including the error description: http_response_code()

See: http://php.net/manual/en/function.http-response-code.php
See also: https://stackoverflow.com/a/12018482

This commit removes the '\Http' utility class and replaces all
calls to 'Http::getMessageForCode()' by 'http_response_code()'
This commit is contained in:
logmanoriginal
2017-08-06 12:47:48 +02:00
parent 62c190d841
commit 99e7e7876e
3 changed files with 4 additions and 62 deletions

View File

@@ -155,7 +155,7 @@ class FacebookBridge extends BridgeAbstract {
//Show captcha filling form to the viewer, proxying the captcha image
$img = base64_encode(getContents($captcha->find('img', 0)->src));
header('HTTP/1.1 500 ' . Http::getMessageForCode(500));
http_response_code(500);
header('Content-Type: text/html');
$message = <<<EOD
<form method="post" action="?{$_SERVER['QUERY_STRING']}">