$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 (is_executable($filename))
+ abort('403 input error', "onwijzigbaar bestand: $filename");
if (!isset($_POST['body']))
abort('409 input error', "geen inhoud aangeleverd");
define('N', "\n");
$editable = FALSE; // "Beheer toegestaan voor {$_SERVER['REMOTE_ADDR']}:";
+
+$curfile = ltrim($_SERVER['SCRIPT_NAME'], '/');
+if (is_executable(__DIR__ . '/' . $curfile)) {
+ // dynamic code is +x
+ $editable = FALSE;
+}
+
if ($editable) {
echo '<p class="footer">'.N;
echo $editable.N;