From cd2ddb57a5a20e308cee912e26f2383733c11b3c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Jan 2009 14:56:48 -0500 Subject: load rpc xml lib on the fly This way, enabling the plugin via websetup is safe, it can't leave ikiwiki in a broken state. --- IkiWiki/Plugin/blogspam.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index 6e68a9856..4005e9f2a 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -4,8 +4,6 @@ package IkiWiki::Plugin::blogspam; use warnings; use strict; use IkiWiki 3.00; -require RPC::XML; -require RPC::XML::Client; my $defaulturl='http://test.blogspam.net:8888/'; @@ -47,6 +45,15 @@ sub getsetup () { sub checkcontent (@) { my %params=@_; + + eval q{ + use RPC::XML; + use RPC::XML::Client; + }; + if ($@) { + warn($@); + return undef; + } if (exists $config{blogspam_pagespec}) { return undef -- cgit v1.2.3