git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49b0543
)
page: text/plain request triggers api mode
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 27 Dec 2020 18:46:06 +0000
(19:46 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Fri, 1 Jan 2021 17:30:40 +0000
(18:30 +0100)
page.php
patch
|
blob
|
history
upload.inc.php
patch
|
blob
|
history
diff --git
a/page.php
b/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
diff --git
a/upload.inc.php
b/upload.inc.php
index f79600f892de3ee018377e1ab9adf460b3ce3646..6175fe20a685b1b1df707ccba8e74f4bad2564f1 100644
(file)
--- a/
upload.inc.php
+++ b/
upload.inc.php
@@
-1,6
+1,4
@@
<?php
-$Page->api = $_SERVER['HTTP_ACCEPT'] == 'text/plain';
-
function userupload($input, $target = NULL, $filename = NULL)
{
switch ($input['error']) {