edit: enable placeholder plugin
[minimedit.git] / edit.php
index cf9b6c07e9f79e95ce7830ba1a56e774fd762fd1..f0d001e9fc6d029d06b24ea49acd147049600f0a 100644 (file)
--- a/edit.php
+++ b/edit.php
@@ -1,4 +1,6 @@
 <?php
+ob_clean();
+
 function abort($status, $body) {
        header("HTTP/1.1 $status");
        print "$body\n";
@@ -32,6 +34,9 @@ if (!strlen($upload)) {
        exit;
 }
 
+if (!file_exists(dirname($filename)) and !mkdir(dirname($filename)))
+       abort('500 save error', "fout bij aanmaken van map voor $filename");
+
 if (!file_put_contents($filename, $upload))
        abort('500 save error', "fout bij schrijven van $filename");