From: Joey Hess Date: Sun, 16 Dec 2007 21:42:18 +0000 (-0500) Subject: * brokenlinks: Don't list the same link multiple times. (%links might X-Git-Tag: 2.16~19 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/c3fed25ad4d301a8e901cf46ba9d11dbf6866d03?ds=inline * brokenlinks: Don't list the same link multiple times. (%links might contain multiple copies of the same link) --- diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index ef5837a58..0295a8fe6 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -22,7 +22,10 @@ sub preprocess (@) { #{{{ foreach my $page (keys %links) { if (pagespec_match($page, $params{pages}, location => $params{page})) { my $discussion=gettext("discussion"); + my %seen; foreach my $link (@{$links{$page}}) { + next if $seen{$link}; + $seen{$link}=1; next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion}; my $bestlink=bestlink($page, $link); next if length $bestlink; diff --git a/debian/changelog b/debian/changelog index 940993baf..50ab0d54d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -53,6 +53,8 @@ ikiwiki (2.16) UNRELEASED; urgency=low liw's disappearing openids). * aggregate: Convert filter hook to a needsbuild hook. * map: Don't inline images. + * brokenlinks: Don't list the same link multiple times. (%links might + contain multiple copies of the same link) -- Joey Hess Mon, 03 Dec 2007 14:47:36 -0500 diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 9a8ccc219..66ff20779 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-12-16 15:48-0500\n" +"POT-Creation-Date: 2007-12-16 16:08-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -42,7 +42,7 @@ msgid "%s is not an editable page" msgstr "" #: ../IkiWiki/CGI.pm:441 ../IkiWiki/Plugin/brokenlinks.pm:24 -#: ../IkiWiki/Plugin/inline.pm:232 ../IkiWiki/Plugin/opendiscussion.pm:17 +#: ../IkiWiki/Plugin/inline.pm:234 ../IkiWiki/Plugin/opendiscussion.pm:17 #: ../IkiWiki/Plugin/orphans.pm:28 ../IkiWiki/Render.pm:98 #: ../IkiWiki/Render.pm:178 msgid "discussion" @@ -204,20 +204,20 @@ msgstr "" msgid "unknown sort type %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:193 +#: ../IkiWiki/Plugin/inline.pm:195 msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:209 +#: ../IkiWiki/Plugin/inline.pm:211 #, perl-format msgid "nonexistant template %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:240 ../IkiWiki/Render.pm:102 +#: ../IkiWiki/Plugin/inline.pm:242 ../IkiWiki/Render.pm:102 msgid "Discussion" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:454 +#: ../IkiWiki/Plugin/inline.pm:456 msgid "RPC::XML::Client not found, not pinging" msgstr ""