recentchanges_link CGI: If the linked page is internal, use its permalink

This fixes a bug, that comments appear in recentchanges as broken links.
master
Simon McVittie 2008-12-22 23:02:08 +00:00
parent 7f1992cbe1
commit 05bb65fc68
1 changed files with 9 additions and 0 deletions

View File

@ -95,6 +95,15 @@ sub cgi ($) {
IkiWiki::loadindex();
# If the page is internal (like a comment), see if it has a
# permalink. Comments do.
if (IkiWiki::isinternal($page) &&
defined $pagestate{$page}{meta}{permalink}) {
IkiWiki::redirect($cgi,
$pagestate{$page}{meta}{permalink});
exit;
}
my $link=bestlink("", $page);
if (! length $link) {
print "Content-type: text/html\n\n";