summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-17 00:09:37 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-17 00:09:37 +0000
commitf1b09207bf7d00dcd34dcafeaa177e9b2640297c (patch)
tree4dda6f818871272fd7257557fa6e5c48141d3183 /doc
parent6d04e7b2026333b00041c291258da3027e49f99a (diff)
web commit by http://id.inelegant.org/: Bug report.
Diffstat (limited to 'doc')
-rw-r--r--doc/bugs/newfile-test.mdwn9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/bugs/newfile-test.mdwn b/doc/bugs/newfile-test.mdwn
new file mode 100644
index 000000000..b5e7428bd
--- /dev/null
+++ b/doc/bugs/newfile-test.mdwn
@@ -0,0 +1,9 @@
+The CGI tries to decide whether an user is trying to edit a new file or not with the following test:
+
+ $form->field(name => "newfile",
+ value => ! -e "$config{srcdir}/$file",
+ force => 1);
+
+Assume the script is called like this `http://example.com/ikiwiki.cgi?page=discussion&from=some-page&do=create`. The `if (exists $pagesources{$page}) {` test determines whether there's a file called `$config{srcdir}/discussion`. Most installs won't have a `$config{srcdir}/discussion` page, so this test will fail causing the else clause to be executed. In this case, the else clause results in `$file` being set to `discussion.mdwn`. Thus, on typical installs `value => ! -e "$config{srcdir}/$file",` always succeeds, which results in the expected behaviour, albeit for the wrong reasons. Similarly, the ` $form->field(name => "rcsinfo", value => rcs_prepedit($file)` line is also meaningless because `$file` isn't what we think it is.
+
+(To confirm that this wasn't just a result of my imagination, I created [[/discussion]] on this site; feel free to delete it now.) \ No newline at end of file