From c7feba44bdf1102b80a09f683321559d18755a24 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 27 Dec 2020 19:46:06 +0100 Subject: [PATCH] page: text/plain request triggers api mode --- page.php | 4 ++++ upload.inc.php | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/page.php b/page.php index a9607c0..95fd01f 100644 --- 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 diff --git a/upload.inc.php b/upload.inc.php index f79600f..6175fe2 100644 --- a/upload.inc.php +++ b/upload.inc.php @@ -1,6 +1,4 @@ api = $_SERVER['HTTP_ACCEPT'] == 'text/plain'; - function userupload($input, $target = NULL, $filename = NULL) { switch ($input['error']) { -- 2.30.0