rename all html files to php
[minimedit.git] / edit.php
index 357d3a429bde2c04f82bb0a452e32cad4f7f2320..94206bb054732b0410370b3b6bfe135f3c3bae77 100755 (executable)
--- a/edit.php
+++ b/edit.php
@@ -10,7 +10,7 @@ if (!$_POST)
 if (!isset($_SERVER['PATH_INFO']) or strlen($_SERVER['PATH_INFO']) <= 1)
        abort('409 input error', "geen bestand aangeleverd");
 
-$filename = preg_replace('/(?:\.html)?$/', '.html', ltrim($_SERVER['PATH_INFO'], '/'), 1);
+$filename = preg_replace('/(?:\.php)?$/', '.php', ltrim($_SERVER['PATH_INFO'], '/'), 1);
 if (file_exists($filename) and !is_writable($filename))
        abort('403 input error', "ongeldige bestandsnaam: $filename");
 if (is_executable($filename))
@@ -29,8 +29,8 @@ if (!strlen($upload)) {
        exit;
 }
 
-$prepend = '<!--#include virtual="/head.inc.html" -->'."\n\n";
-$append  = "\n".'<!--#include virtual="/foot.inc.html" -->'."\n";
+$prepend = "<?php include 'head.inc.php'; ?>\n\n";
+$append  = "\n";
 
 if (!file_put_contents($filename, $prepend . $upload . $append))
        abort('500 save error', "fout bij schrijven van $filename");