Improved settings of CSPs.
Added manifest.json. Added further security-related HTTP headers.
This commit is contained in:
40
manifest.php
Normal file
40
manifest.php
Normal 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);
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user