]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/recentchanges.pm
update
[git.ikiwiki.info.git] / IkiWiki / Plugin / recentchanges.pm
index 12577e9efc9f56e1748a160a6cdab5b768540501..ef108b3f00d4f031ef3ca3b0f1bab228f0dce279 100644 (file)
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::recentchanges;
 
 use warnings;
 use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
 use Encode;
 use HTML::Entities;
 
@@ -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";