edit: detect executable files as uneditable
[minimedit.git] / foot.inc.php
old mode 100644 (file)
new mode 100755 (executable)
index 7723e30..d2ba826
@@ -13,6 +13,13 @@ EOT;
 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;