page: show edit link for new pages v2.4
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 21 Oct 2017 00:05:26 +0000 (02:05 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 22 Oct 2017 12:08:41 +0000 (14:08 +0200)
Only existing files can be writable.  Otherwise parent directory should be
checked (recursively), but just assume unrestricted permissions for now.

page.inc.php

index 54a39445b42994d777bc5e97fc23d47b7499c888..333a70521e5de72c69d20904902fe679dbc4a5dc 100644 (file)
@@ -20,7 +20,7 @@ if (!empty($User)) {
                else {
                        $editpage .= '.html';
                }
-               if (is_writable($editpage)) {
+               if (!file_exists($editpage) or is_writable($editpage)) {
                        print ' <a href="#edit">Wijzig</a>';
                }
        }