page: text/plain request triggers api mode
[minimedit.git] / page.php
index a9607c0cf9ab49d60d7dc78aaca2cba629cedbc3..95fd01fdb716d99c98c3e71485df69926a3dbaf6 100644 (file)
--- a/page.php
+++ b/page.php
@@ -26,6 +26,10 @@ elseif (file_exists("$request/index.html")) {
 require_once('article.inc.php');
 $Page = new ArchiveArticle($staticpage);
 
+if ($_SERVER['HTTP_ACCEPT'] === 'text/plain') {
+       $Page->api = TRUE;
+}
+
 # user login and control
 
 include_once 'auth.inc.php'; // sets global $User