]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/editpage.pm
Add modified opengraph plugin.
[git.ikiwiki.info.git] / IkiWiki / Plugin / editpage.pm
index d15607990db2412b8a14f281864f82f98b3cac7f..99a1429143eee57db87269dd759a9d28111a9e73 100644 (file)
@@ -305,7 +305,8 @@ sub cgi_editpage ($$) {
                        my @page_types;
                        if (exists $hooks{htmlize}) {
                                foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) {
-                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key];
+                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key]
+                                               unless $hooks{htmlize}{$key}{nocreate};
                                }
                        }
                        @page_types=sort @page_types;
@@ -342,7 +343,7 @@ sub cgi_editpage ($$) {
        else {
                # save page
                check_canedit($page, $q, $session);
-               checksessionexpiry($q, $session, $q->param('sid'));
+               checksessionexpiry($q, $session);
 
                my $exists=-e "$config{srcdir}/$file";
 
@@ -400,10 +401,12 @@ sub cgi_editpage ($$) {
                eval { writefile($file, $config{srcdir}, $content) };
                $config{cgi}=1;
                if ($@) {
+                       # save $@ in case a called function clobbers it
+                       my $error = $@;
                        $form->field(name => "rcsinfo", value => rcs_prepedit($file),
                                force => 1);
                        my $mtemplate=template("editfailedsave.tmpl");
-                       $mtemplate->param(error_message => $@);
+                       $mtemplate->param(error_message => $error);
                        $form->tmpl_param("message", $mtemplate->output);
                        $form->field("editcontent", value => $content, force => 1);
                        $form->tmpl_param("page_select", 0);
@@ -428,7 +431,7 @@ sub cgi_editpage ($$) {
                        $conflict=rcs_commit(
                                file => $file,
                                message => $message,
-                               token => $form->field("rcsinfo"),
+                               token => scalar $form->field("rcsinfo"),
                                session => $session,
                        );
                        enable_commit_hook();