]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/CGI.pm
web commit by WillThompson: Safety of arbitrary regexen
[ikiwiki.git] / IkiWiki / CGI.pm
index 08d79614217e0855a35fb99565c7adc5d5e0ea60..fa2287e82d4e20033076d259996f6097ae96575c 100644 (file)
@@ -39,6 +39,7 @@ sub cgi_recentchanges ($) { #{{{
                wikiname => $config{wikiname},
                changelog => [rcs_recentchanges(100)],
                styleurl => styleurl(),
+               baseurl => "$config{url}/",
        );
        print $q->header, $template->output;
 } #}}}
@@ -62,7 +63,8 @@ sub cgi_signin ($$) { #{{{
                required => 'NONE',
                javascript => 0,
                params => $q,
-               action => $q->request_uri,
+               # Why was this added?
+               #action => $q->request_uri,
                header => 0,
                template => (-e "$config{templatedir}/signin.tmpl" ?
                              "$config{templatedir}/signin.tmpl" : ""),
@@ -329,6 +331,7 @@ sub cgi_editpage ($$) { #{{{
        $form->tmpl_param("helponformattinglink",
                htmllink("", "HelpOnFormatting", 1));
        $form->tmpl_param("styleurl", styleurl());
+       $form->tmpl_param("baseurl", "$config{url}/");
        if (! $form->submitted) {
                $form->field(name => "rcsinfo", value => rcs_prepedit($file),
                        force => 1);
@@ -487,13 +490,14 @@ sub cgi () { #{{{
        
        my $q=CGI->new;
        
-       if (defined $q->param('phrase')) {
-               cgi_hyperestraier();
-       }
-       
        my $do=$q->param('do');
        if (! defined $do || ! length $do) {
-               error("\"do\" parameter missing");
+               if (defined $q->param('phrase')) {
+                       cgi_hyperestraier();
+               }
+               else {
+                       error("\"do\" parameter missing");
+               }
        }
        
        # Things that do not need a session.
@@ -508,7 +512,7 @@ sub cgi () { #{{{
        CGI::Session->name("ikiwiki_session_$config{wikiname}");
        
        my $oldmask=umask(077);
-       my $session = CGI::Session->new("driver:db_file", $q,
+       my $session = CGI::Session->new("driver:DB_File", $q,
                { FileName => "$config{wikistatedir}/sessions.db" });
        umask($oldmask);