aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/CGI.pm15
-rw-r--r--IkiWiki/Plugin/aggregate.pm3
-rw-r--r--IkiWiki/Render.pm1
3 files changed, 9 insertions, 10 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index f69f02a15..db97740f6 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -346,12 +346,11 @@ sub cgi_editpage ($$) { #{{{
# This untaint is safe because titlepage removes any problematic
# characters.
my ($page)=$form->field('page');
- $page=titlepage(possibly_foolish_untaint(lc($page)));
+ $page=titlepage(possibly_foolish_untaint($page));
if (! defined $page || ! length $page ||
$page=~/$config{wiki_file_prune_regexp}/ || $page=~/^\//) {
error("bad page name");
}
- $page=lc($page);
my $from;
if (defined $form->field('from')) {
@@ -359,7 +358,7 @@ sub cgi_editpage ($$) { #{{{
}
my $file;
- my $type;
+ my $type;
if (exists $pagesources{$page}) {
$file=$pagesources{$page};
$type=pagetype($file);
@@ -457,7 +456,7 @@ sub cgi_editpage ($$) { #{{{
}
@page_locs = grep {
- ! exists $pagesources{lc($_)} &&
+ ! exists $pagecase{lc $_} &&
! page_locked($_, $session, 1)
} @page_locs;
@@ -485,8 +484,8 @@ sub cgi_editpage ($$) { #{{{
if (! defined $form->field('editcontent') ||
! length $form->field('editcontent')) {
my $content="";
- if (exists $pagesources{lc($page)}) {
- $content=readfile(srcfile($pagesources{lc($page)}));
+ if (exists $pagesources{$page}) {
+ $content=readfile(srcfile($pagesources{$page}));
$content=~s/\n/\r\n/g;
}
$form->field(name => "editcontent", value => $content,
@@ -617,11 +616,11 @@ sub cgi () { #{{{
cgi_prefs($q, $session);
}
elsif ($do eq 'blog') {
- my $page=titlepage(lc($q->param('title')));
+ my $page=titlepage($q->param('title'));
# if the page already exists, munge it to be unique
my $from=$q->param('from');
my $add="";
- while (exists $oldpagemtime{"$from/$page$add"}) {
+ while (exists $pagecase{lc "$from/$page$add"}) {
$add=1 unless length $add;
$add++;
}
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 633618f76..2e4026757 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -260,13 +260,12 @@ sub add_page (@) { #{{{
# directory name or trigger ".." disallowing code.
$page=~s!([/.])!"__".ord($1)."__"!eg;
$page=$feed->{dir}."/".$page;
- $page=lc($page);
($page)=$page=~/$IkiWiki::config{wiki_file_regexp}/;
if (! defined $page || ! length $page) {
$page=$feed->{dir}."/item";
}
my $c="";
- while (exists $IkiWiki::pagesources{$page.$c} ||
+ while (exists $IkiWiki::pagecase{lc $page} ||
-e pagefile($page.$c)) {
$c++
}
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index b855d2c8f..b4b95e8d4 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -358,6 +358,7 @@ sub refresh () { #{{{
debug("new page $page") unless exists $pagectime{$page};
push @add, $file;
$links{$page}=[];
+ $pagecase{lc $page}=$page;
$pagesources{$page}=$file;
if ($config{getctime} && -e "$config{srcdir}/$file") {
$pagectime{$page}=rcs_getctime("$config{srcdir}/$file");