page: omit editing <div> container for xml response
[minimedit.git] / page.php
index f9dabf07caf4f7a9e3e2d231a4e67f6efad86da9..8a37533f4c6e78e928980c5a92454f3e589be83d 100644 (file)
--- a/page.php
+++ b/page.php
@@ -26,7 +26,7 @@ elseif (file_exists("$request/index.html")) {
 require_once('article.inc.php');
 $Page = new ArchiveArticle($staticpage);
 
-if ($_SERVER['HTTP_ACCEPT'] === 'text/plain') {
+if (@$_SERVER['HTTP_ACCEPT'] === 'text/plain') {
        $Page->api = TRUE;
 }
 
@@ -60,7 +60,8 @@ if ($Page->editable = $User->admin("edit {$Page->link}")) {
        include_once 'edit/head.inc.php';
 }
 
-if (isset($Page->raw)) {
+if (isset($Page->raw)
+and @$_SERVER['HTTP_ACCEPT'] !== 'application/xml') {
        $Page->raw = '<div class="static">'."\n\n".$Page->raw."</div>\n\n";
 }
 
@@ -83,7 +84,7 @@ else {
        }
 }
 
-if ($_SERVER['HTTP_ACCEPT'] === 'application/xml') {
+if (@$_SERVER['HTTP_ACCEPT'] === 'application/xml') {
        header('Access-Control-Allow-Origin: *');
 }
 elseif (!$Page->api) {