aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-13 02:03:43 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-13 02:03:43 +0000
commit4b36dee35a55b08d6d6f3bb3840220a4956f2540 (patch)
tree4202c4fa32c2ec537e065072e45b4bb9344b1147 /IkiWiki
parent85ecbc6c4ea3af0b39034d985d4ca4adb243d94f (diff)
downloadikiwiki-4b36dee35a55b08d6d6f3bb3840220a4956f2540.tar
ikiwiki-4b36dee35a55b08d6d6f3bb3840220a4956f2540.tar.gz
* The last release accidentially installed ikiwiki as ikiwiki.pl, now fixed.
* Add --version. * Man page format fixups. * Add a %pagecase which maps lower-case page names to the actual case used in the filename. Use this in bestlinks calculation instead of forcing the link to lowercase. * Also use %pagecase in various other places that want to check if a page with a given name exists. * This means that links to pages with mixed case names will now work, even if the link is in some other case mixture, and mixed case pages should be fully supported throughout ikiwiki. * Recommend rebuilding wikis on upgrade to this version.
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");