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: encode page url in path
[minimedit.git]
/
edit.php
diff --git
a/edit.php
b/edit.php
index 657c2790e570a841011790204097be7170ab2e4d..719c2f029976b523d953de8337331b24ac2cd8f8 100644
(file)
--- a/
edit.php
+++ b/
edit.php
@@
-7,10
+7,10
@@
function abort($status, $body) {
if (!$_POST)
abort('405 post error', "niets te doen");
if (!$_POST)
abort('405 post error', "niets te doen");
-if (!isset($_
POST['page'])
)
+if (!isset($_
SERVER['PATH_INFO']) or strlen($_SERVER['PATH_INFO']) <= 1
)
abort('409 input error', "geen bestand aangeleverd");
abort('409 input error', "geen bestand aangeleverd");
-$filename = preg_replace('/(?:\.html)?$/', '.html', ltrim($_
POST['page
'], '/'), 1);
+$filename = preg_replace('/(?:\.html)?$/', '.html', ltrim($_
SERVER['PATH_INFO
'], '/'), 1);
if (file_exists($filename) and !is_writable($filename))
abort('403 input error', "ongeldige bestandsnaam: $filename");
if (file_exists($filename) and !is_writable($filename))
abort('403 input error', "ongeldige bestandsnaam: $filename");