]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/fortune.pm
* Turn $config{wiki_file_prune_regexps} into an array that is easier to
[ikiwiki.git] / IkiWiki / Plugin / fortune.pm
index 8e96bdbbd1e442be73b45586f3fd276b2ea9b0e2..4ff343e3a0c891f5e7b0fd7019706f946d16be61 100644 (file)
@@ -2,17 +2,17 @@
 # Include a fortune in a page
 package IkiWiki::Plugin::fortune;
 
+use IkiWiki;
 use warnings;
 use strict;
 
 sub import { #{{{
-       IkiWiki::hook(type => "preprocess", id => "fortune",
-               call => \&preprocess);
+       hook(type => "preprocess", id => "fortune", call => \&preprocess);
 } # }}}
 
 sub preprocess (@) { #{{{
        $ENV{PATH}="$ENV{PATH}:/usr/games:/usr/local/games";
-       my $f = `fortune`;
+       my $f = `fortune 2>/dev/null`;
 
        if ($?) {
                return "[[fortune failed]]";