From: Mischa POSLAWSKY Date: Mon, 28 Dec 2020 02:41:50 +0000 (+0100) Subject: page: allow remote access for xml requests X-Git-Tag: v5.1~4 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/a17b3a77e5774bdb135c6eb017daa5e02d8c5562?hp=1e6e0732eb889ea7f8ca17ba467bf2a9a2ff5cbd page: allow remote access for xml requests Made for inclusion from scripts such as dashboard page. --- diff --git a/page.php b/page.php index 0c101f8..3e3f4cc 100644 --- a/page.php +++ b/page.php @@ -83,7 +83,10 @@ else { } } -if (!$Page->api and $_SERVER['HTTP_ACCEPT'] !== 'application/xml') { +if ($_SERVER['HTTP_ACCEPT'] === 'application/xml') { + header('Access-Control-Allow-Origin: *'); +} +elseif (!$Page->api) { include_once 'page.inc.php'; } print $Page->render();