aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/rename.pm
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2009-01-27 16:57:52 +0100
committerintrigeri <intrigeri@boum.org>2009-01-27 17:08:55 +0100
commit51badc960d933f6d0670cc76390c332a31b35d63 (patch)
tree6adcb19e6f07399791ca150a19b0ad7acca89817 /IkiWiki/Plugin/rename.pm
parent58481dcdf623aed8ab840ab86e3ac065c4bcb8a1 (diff)
downloadikiwiki-51badc960d933f6d0670cc76390c332a31b35d63.tar
ikiwiki-51badc960d933f6d0670cc76390c332a31b35d63.tar.gz
rename hook: instead of modifying the passed-by-name array, return a copy
This is intended to solve Joey's concerns expressed on http://ikiwiki.info/todo/need_global_renamepage_hook/, i.e. the need to make it possible to use this hook from external plugins. A plugin using this hook still can add/modify/remove elements of the @torename array. Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki/Plugin/rename.pm')
-rw-r--r--IkiWiki/Plugin/rename.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm
index 90af1b4a9..f39c93332 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
@@ -312,7 +312,13 @@ sub sessioncgi ($$) {
required => 1,
};
- IkiWiki::run_hooks(rename => sub { shift->(\@torename, $q, $session); });
+ IkiWiki::run_hooks(rename => sub {
+ @torename=shift->(
+ torename => \@torename,
+ cgi => $q,
+ session => $session
+ );
+ });
# See if any subpages need to be renamed.
if ($q->param("subpages") && $src ne $dest) {