edit: recursively create missing directories
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 21 Oct 2017 00:05:49 +0000 (02:05 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 22 Oct 2017 12:08:41 +0000 (14:08 +0200)
edit.php

index 4e51097c68a4acc599658ac9b0d172325da8507f..8f3abc5b1cf7665eb9f64b8431540a0c2a63c70b 100644 (file)
--- a/edit.php
+++ b/edit.php
@@ -54,7 +54,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))