X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/011d88052d6dacb6a9d84b1489d37eefeb992da1..9480dc44277ad9301f1e1eba5b09990b459e7b26:/IkiWiki/Plugin/inline.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 2d47cb4be..2df59f414 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -329,12 +329,17 @@ sub preprocess_inline (@) { if (! $feedonly) { my $template; if (! $raw) { + # cannot use wiki pages as templates; template not sanitized due to + # format hook hack eval { $template=template_depends($params{template}.".tmpl", $params{page}, blind_cache => 1); }; - if ($@ || ! $template) { - error sprintf(gettext("nonexistant template %s.tmpl"), $params{template}); + if ($@) { + error gettext("failed to process template:")." $@"; + } + if (! $template) { + error sprintf(gettext("template %s not found"), $params{template}.".tmpl"); } } my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content')); @@ -353,7 +358,7 @@ sub preprocess_inline (@) { $template->param(pageurl => urlto($page, $params{destpage})); $template->param(inlinepage => $page); $template->param(title => pagetitle(basename($page))); - $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); + $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}, 1)); $template->param(mtime => displaytime($pagemtime{$page}, $params{timeformat})); $template->param(first => 1) if $page eq $list[0]; $template->param(last => 1) if $page eq $list[$#list]; @@ -495,16 +500,6 @@ sub date_822 ($) { return $ret; } -sub date_3339 ($) { - my $time=shift; - - my $lc_time=POSIX::setlocale(&POSIX::LC_TIME); - POSIX::setlocale(&POSIX::LC_TIME, "C"); - my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", gmtime($time)); - POSIX::setlocale(&POSIX::LC_TIME, $lc_time); - return $ret; -} - sub absolute_urls ($$) { # sucky sub because rss sucks my $content=shift;