Merge pull request #5253 from rabuzarus/20180616_-_magic_auth_test_2

Port hubzillas OpenWebAuth - remote authentification
This commit is contained in:
Hypolite Petovan 2018-06-20 17:46:04 -04:00 committed by GitHub
commit a5550b4702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1196 additions and 50 deletions

View file

@ -163,17 +163,17 @@ EOT;
}
/**
* @brief Encodes content to json
* @brief Encodes content to json.
*
* This function encodes an array to json format
* and adds an application/json HTTP header to the output.
* After finishing the process is getting killed.
*
* @param array $x The input content
* @param array $x The input content.
* @param string $content_type Type of the input (Default: 'application/json').
*/
public static function jsonExit($x)
{
header("content-type: application/json");
public static function jsonExit($x, $content_type = 'application/json') {
header("Content-type: $content_type");
echo json_encode($x);
killme();
}