diff --git a/index.php b/index.php index 3e03a20..0196cd2 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ if (!isLoggedIn()) { if($routerRequest["site_name"] == "sitemap.xml") { require "lib/sitemap.php"; - echo generateSitemap(); + generateSitemap(); exit(); } diff --git a/lib/sitemap.php b/lib/sitemap.php index 09fa79d..7523edb 100644 --- a/lib/sitemap.php +++ b/lib/sitemap.php @@ -2,7 +2,7 @@ require_once "lib/account.php"; -function generateSitemap(): string { +function generateSitemap(): void{ global $routerConfig; $site_dirs = array_diff(scandir($routerConfig["page_dir"]), array('.', '..')); @@ -52,5 +52,6 @@ function generateSitemap(): string { $sitemap .= '' . PHP_EOL; - return $sitemap; + header('Content-type: application/xml'); + echo $sitemap; } \ No newline at end of file