page: provide abort function from edit
[minimedit.git] / edit.php
index 4e51097c68a4acc599658ac9b0d172325da8507f..25f9f1be5454506c137cdc85a698357380810159 100644 (file)
--- a/edit.php
+++ b/edit.php
@@ -1,12 +1,6 @@
 <?php
 ob_clean();
 
-function abort($body, $status = NULL) {
-       if ($status) header("HTTP/1.1 $status");
-       print "$body\n";
-       exit;
-}
-
 if (empty($User['admin']))
        abort("geen beheersrechten", '401 unauthorised');
 
@@ -54,7 +48,7 @@ if (!strlen($upload)) {
        abort("Bestand verwijderd");
 }
 
-if (!file_exists(dirname($filename)) and !mkdir(dirname($filename)))
+if (!file_exists(dirname($filename)) and !mkdir(dirname($filename), 0777, TRUE))
        abort("fout bij aanmaken van map voor $filename", '500 save error');
 
 if (!file_put_contents($filename, $upload))