my $dest=shift; # where it's going to be put, under the srcdir
my $file=shift; # the path to the attachment currently
+ # Don't allow an attachment to be uploaded with the same name as an
+ # existing page.
+ if (exists $pagesources{$dest} && $pagesources{$dest} ne $dest) {
+ error(sprintf(gettext("there is already a page named %s"), $dest));
+ }
+
# Use a special pagespec to test that the attachment is valid.
my $allowed=1;
foreach my $admin (@{$config{adminuser}}) {
* Add allow_symlinks_before_srcdir config setting that can be used to avoid
a security check that is a good safe default, but problimatic overkill in
some situations.
+ * Don't allow uploading an attachment with the same name as an existing
+ page, to avoid confusion.
-- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2008 11:35:46 -0400