From: Joey Hess Date: Sat, 22 Dec 2007 18:36:24 +0000 (-0500) Subject: Merge branch 'master' of ssh://git.kitenet.net/srv/git/ikiwiki.info X-Git-Tag: 2.17~21 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/0e4da6b73b5c274b3fc832d5a602c6363efbcbad?hp=01fb89bcd4d5e28ced28383aeb6a7720efdaa12b Merge branch 'master' of ssh://git.kitenet.net/srv/git/ikiwiki.info --- diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 8555e1109..987262a48 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -108,13 +108,16 @@ sub preprocess (@) { #{{{ return "" if $page ne $destpage; my $safe=0; if ($value !~ /^\w+:\/\//) { - add_depends($page, $value); - my $link=bestlink($page, $value); + my ($redir_page, $redir_anchor) = split /\#/, $value; + + add_depends($page, $redir_page); + my $link=bestlink($page, $redir_page); if (! length $link) { return "[[meta ".gettext("redir page not found")."]]"; } $value=urlto($link, $page); + $value.='#'.$redir_anchor if defined $redir_anchor; $safe=1; # redir cycle detection diff --git a/debian/changelog b/debian/changelog index 75462b6f9..8d91bd95c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ ikiwiki (2.17) UNRELEASED; urgency=low * Improved parentlinks special case for index pages. + * redir: Support for specifying anchors. -- Joey Hess Wed, 19 Dec 2007 16:39:07 -0500 diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn index 0696dc08e..479d62c43 100644 --- a/doc/plugins/meta.mdwn +++ b/doc/plugins/meta.mdwn @@ -85,6 +85,9 @@ Supported fields: However, this latter syntax won't be allowed if the [[htmlscrubber]] is enabled, since it can be used to insert unsafe content. + For both cases, an anchor to jump to inside the destination page may also be + specified using the common `PAGE#ANCHOR` syntax. + If the field is not one of the above predefined fields, the metadata will be written to the generated html page as a <meta> header. However, this won't be allowed if the [[htmlscrubber]] is enabled, since it can be used to diff --git a/doc/security.mdwn b/doc/security.mdwn index 6e1d56a52..c51cd5b95 100644 --- a/doc/security.mdwn +++ b/doc/security.mdwn @@ -341,7 +341,7 @@ There are at least two configurations where this is exploitable: notice. This security hole was discovered on 26 November 2007 and fixed the same -da with the release of ikiwiki 2.14. I recommend upgrading to this version +day with the release of ikiwiki 2.14. I recommend upgrading to this version if your wiki can be committed to by third parties. Alternatively, don't use a trailing slash in the srcdir, and avoid the (unusual) configurations that allow the security hole to be exploited.