git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
edit/page: ignore saving unaltered body
[minimedit.git]
/
page.php
diff --git
a/page.php
b/page.php
index dae508103159e3518fab45a6334ba14255a95710..f9dabf07caf4f7a9e3e2d231a4e67f6efad86da9 100644
(file)
--- a/
page.php
+++ b/
page.php
@@
-56,7
+56,7
@@
$Page->place += [
'url' => htmlspecialchars($_SERVER['REQUEST_URI']),
];
'url' => htmlspecialchars($_SERVER['REQUEST_URI']),
];
-if ($User->admin("edit {$Page->link}")) {
+if ($
Page->editable = $
User->admin("edit {$Page->link}")) {
include_once 'edit/head.inc.php';
}
include_once 'edit/head.inc.php';
}
@@
-69,7
+69,7
@@
if (isset($Page->raw)) {
include_once 'format.inc.php';
ob_start();
include_once 'format.inc.php';
ob_start();
-if ($Page->handler and !
require("./{$Page->handler}/index.php"
)) {
+if ($Page->handler and !
$Page->index($Page->api
)) {
# replace contents by code output on false return
$Page->raw = ob_get_clean();
}
# replace contents by code output on false return
$Page->raw = ob_get_clean();
}
@@
-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();
include_once 'page.inc.php';
}
print $Page->render();