X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0afcec734622811b8910d3df5d102df58d429a51..b1f31ab7cbc87a572886673e7809d5e2fc5ee491:/IkiWiki/Plugin/getsource.pm diff --git a/IkiWiki/Plugin/getsource.pm b/IkiWiki/Plugin/getsource.pm index 6a208f1e7..1b7eb56c6 100644 --- a/IkiWiki/Plugin/getsource.pm +++ b/IkiWiki/Plugin/getsource.pm @@ -66,6 +66,17 @@ sub cgi_getsource ($) { exit; } + if (! defined pagetype($IkiWiki::pagesources{$page})) { + IkiWiki::cgi_custom_failure( + $cgi->header(-status => "403 Forbidden"), + IkiWiki::misctemplate(gettext("not a page"), + "
". + sprintf(gettext("%s is an attachment, not a page."), + htmllink("", "", $page)). + "
")); + exit; + } + my $data = IkiWiki::readfile(IkiWiki::srcfile($IkiWiki::pagesources{$page})); if (! $config{getsource_mimetype}) {