]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/CGI.pm
resp
[git.ikiwiki.info.git] / IkiWiki / CGI.pm
index 43986789a45614417f3837cf297c2840acb37455..99cead64fcbbf5461820720c415f5eb91e8a58fc 100644 (file)
@@ -281,7 +281,6 @@ sub cgi_editpage ($$) { #{{{
        eval q{use CGI::FormBuilder};
        error($@) if $@;
        my $form = CGI::FormBuilder->new(
-               title => "editpage",
                fields => \@fields,
                charset => "utf-8",
                method => 'POST',
@@ -302,10 +301,9 @@ sub cgi_editpage ($$) { #{{{
        });
        decode_form_utf8($form);
        
-       # This untaint is safe because titlepage removes any problematic
-       # characters.
-       my ($page)=$form->field('page');
-       $page=titlepage(possibly_foolish_untaint($page));
+       # This untaint is safe because we check file_pruned.
+       my $page=$form->field('page');
+       $page=possibly_foolish_untaint($page);
        if (! defined $page || ! length $page ||
            file_pruned($page, $config{srcdir}) || $page=~/^\//) {
                error("bad page name");
@@ -355,7 +353,7 @@ sub cgi_editpage ($$) { #{{{
        $form->field(name => "from", type => 'hidden');
        $form->field(name => "rcsinfo", type => 'hidden');
        $form->field(name => "subpage", type => 'hidden');
-       $form->field(name => "page", value => pagetitle($page, 1), force => 1);
+       $form->field(name => "page", value => $page, force => 1);
        $form->field(name => "type", value => $type, force => 1);
        $form->field(name => "comments", type => "text", size => 80);
        $form->field(name => "editcontent", type => "textarea", rows => 20,
@@ -487,8 +485,8 @@ sub cgi_editpage ($$) { #{{{
                        
                        $form->tmpl_param("page_select", 1);
                        $form->field(name => "page", type => 'select',
-                               options => [ map { pagetitle($_, 1) } @editable_locs ],
-                               value => pagetitle($best_loc, 1));
+                               options => [ map { [ $_, pagetitle($_, 1) ] } @editable_locs ],
+                               value => $best_loc);
                        $form->field(name => "type", type => 'select',
                                options => \@page_types);
                        $form->title(sprintf(gettext("creating %s"), pagetitle($page)));
@@ -669,7 +667,7 @@ sub cgi (;$$) { #{{{
 
        eval q{use CGI};
        error($@) if $@;
-       $CGI::DISABLE_UPLOADS=1;
+       $CGI::DISABLE_UPLOADS=$config{cgi_disable_uploads};
 
        if (! $q) {
                binmode(STDIN);