# This untaint is safe because we check file_pruned.
my $page=$form->field('page');
$page=possibly_foolish_untaint($page);
+ my $absolute=($page =~ s#^/+##);
if (! defined $page || ! length $page ||
- file_pruned($page, $config{srcdir}) || $page=~/^\//) {
+ file_pruned($page, $config{srcdir})) {
error("bad page name");
}
if (! defined $from || ! length $from ||
$from ne $form->field('from') ||
file_pruned($from, $config{srcdir}) ||
- $from=~/^\// ||
+ $from=~/^\// ||
+ $absolute ||
$form->submitted eq "Preview") {
@page_locs=$best_loc=$page;
}
with no whitespace.
* ikiwiki-transition: Fix command-line processing so the prefix_directives
transition works again.
+ * Fixes creation of pages when clicking on WikiLinks starting with "/".
-- Josh Triplett <josh@freedesktop.org> Wed, 09 Jul 2008 21:30:33 -0700
+++ /dev/null
-This is a link to a non-existent page in the root directory: [[/root_page_test]] (\[[/root\_page\_test]])
-
-When you click on the question mark to create the page, you get *Error: bad page name*. It's a valid [[wikilink]], shouldn't it create the page? --[[sabr]]
-
-> Is it a valid wikilink? Should Iki prevent the page from being created? --[[sabr]], 2 months later
-
-This type of page name (with leading slash) also gets created by the aggregate plugin: /cgi-bin/ikiwiki.cgi?page=%2FCalculated_Risk&from=news%2FAll_Stories&do=create I'm now pretty convinced that Iki should handle this without error. I'll investigate if I can find the time.