]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/inline.pm
web commit by hb
[git.ikiwiki.info.git] / IkiWiki / Plugin / inline.pm
index f90d87ae2cebe98273b6a6fa6f20cd6a621c2088..fd7a59ab39cecd12857ebb55de80467d74eb6439 100644 (file)
@@ -135,7 +135,7 @@ sub preprocess_inline (@) { #{{{
                                my $type = pagetype($file);
                                if ($config{discussion}) {
                                        $template->param(have_actions => 1);
-                                       $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
+                                       $template->param(discussionlink => htmllink($page, $params{page}, "Discussion", 1, 1));
                                }
                                if (length $config{cgiurl} && defined $type) {
                                        $template->param(have_actions => 1);
@@ -336,7 +336,7 @@ sub genfeed ($$$$@) { #{{{
 } #}}}
 
 sub pingurl (@) { #{{{
-       return unless $config{pingurl} && %toping;
+       return unless @{$config{pingurl}} && %toping;
 
        eval q{require RPC::XML::Client};
        if ($@) {
@@ -345,13 +345,13 @@ sub pingurl (@) { #{{{
        }
 
        # daemonize here so slow pings don't slow down wiki updates
-       eval q{use POSIX ’setsid’};
-       chdir '/';
-       open STDIN, '/dev/null';
-       open STDOUT, '>/dev/null';
        defined(my $pid = fork) or error("Can't fork: $!");
        return if $pid;
+       chdir '/';
+       eval q{use POSIX ’setsid’};
        setsid() or error("Can't start a new session: $!");
+       open STDIN, '/dev/null';
+       open STDOUT, '>/dev/null';
        open STDERR, '>&STDOUT' or error("Can’t dup stdout: $!");
 
        # Don't need to keep a lock on the wiki as a daemon.