getsource: remove unnecessary IkiWiki:: prefixes
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sun, 26 Jul 2009 15:59:26 +0000 (16:59 +0100)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Sun, 26 Jul 2009 16:04:49 +0000 (17:04 +0100)
Many variables and functions are exported.

IkiWiki/Plugin/getsource.pm

index 1b7eb56c67f5cfb3ed04e93df49d8c01fb47be02..db5614ec18081e1d4f877183acb370e855ee6aed 100644 (file)
@@ -43,7 +43,7 @@ sub cgi_getsource ($) {
        my $cgi=shift;
 
        # Note: we use sessioncgi rather than just cgi
-       # because we need $IkiWiki::pagesources{} to be
+       # because we need %pagesources to be
        # populated.
 
        return unless (defined $cgi->param('do') &&
@@ -55,7 +55,7 @@ sub cgi_getsource ($) {
 
        IkiWiki::loadindex();
 
-       if (! exists $IkiWiki::pagesources{$page}) {
+       if (! exists $pagesources{$page}) {
                IkiWiki::cgi_custom_failure(
                        $cgi->header(-status => "404 Not Found"),
                        IkiWiki::misctemplate(gettext("missing page"),
@@ -66,7 +66,7 @@ sub cgi_getsource ($) {
                exit;
        }
 
-       if (! defined pagetype($IkiWiki::pagesources{$page})) {
+       if (! defined pagetype($pagesources{$page})) {
                IkiWiki::cgi_custom_failure(
                        $cgi->header(-status => "403 Forbidden"),
                        IkiWiki::misctemplate(gettext("not a page"),
@@ -77,7 +77,7 @@ sub cgi_getsource ($) {
                exit;
        }
 
-       my $data = IkiWiki::readfile(IkiWiki::srcfile($IkiWiki::pagesources{$page}));
+       my $data = readfile(srcfile($pagesources{$page}));
 
        if (! $config{getsource_mimetype}) {
                $config{getsource_mimetype} = "text/plain; charset=utf-8";