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
ikiwiki (2.17) UNRELEASED; urgency=low
* Improved parentlinks special case for index pages.
+ * redir: Support for specifying anchors.
-- Joey Hess <joeyh@debian.org> Wed, 19 Dec 2007 16:39:07 -0500
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
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.