Improved settings of CSPs.

Added manifest.json.
Added further security-related HTTP headers.
This commit is contained in:
2018-06-18 13:57:35 +02:00
committed by Stefan Rohde-Enslin
parent 1acdc7ba2b
commit 067beedf29
12 changed files with 165 additions and 34 deletions

40
manifest.php Normal file
View File

@ -0,0 +1,40 @@
<?PHP
/**
* This file generates a web manifest based on the settings.
*
* @author Joshua Ramon Enslin <joshua@jrenslin.de>
*/
// Include functions and settings.
require_once __DIR__ . "/inc/functions.php";
// Ensure working environment for frontend.
ensureEnvironment();
// Fill output array
$data = [];
$data["name"] = $data['short_name'] = $settings['pageTitle'];
$data["start_url"] = "/";
$data["display"] = "standalone";
$data["background_color"] = "#000";
$data["theme_color"] = "#AFB42B";
$data["description"] = "Website of " . $settings['pageTitle'];
/*
$data['icons'] = [
"src" => $settings['logo'],
"type" => mime_content_type(__DIR__ . $settings['logo'])
];
*/
// Return JSON-encoded data.
header('Content-Type: application/json');
echo json_encode($data, JSON_PRETTY_PRINT);
?>