From 678d467a4080dd549f2b6f276f963eac384e1b4f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 23 Dec 2008 16:34:19 -0500 Subject: finalise version 3.00 of the plugin api --- IkiWiki/Plugin/websetup.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki/Plugin/websetup.pm') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 66dacfde3..a47c29976 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -3,7 +3,7 @@ package IkiWiki::Plugin::websetup; use warnings; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "websetup", call => \&getsetup); -- cgit v1.2.3 From 0daa4eb521a32b9ed00e99a2155416a312d478de Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 31 Dec 2008 00:08:46 -0500 Subject: make sure value is defined before using it as an array --- IkiWiki/Plugin/websetup.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin/websetup.pm') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index a47c29976..2d978c5b4 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -138,7 +138,8 @@ sub showfields ($$$@) { my $value=$config{$key}; - if ($info{safe} && (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { + if ($info{safe} && defined $value && + (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { $value=[@{$value}, "", ""]; # blank items for expansion } -- cgit v1.2.3 From 3e8b7a6b196767d2c7d21790b6ed7c3fb5f70d31 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 31 Dec 2008 00:44:54 -0500 Subject: websetup: Avoid a crash when a new array setup item has been added in a new ikiwiki release, and is thus not present in the setup file yet. This happened with camelcase_ignore. The code tried to convert the undef value for it into an array. --- IkiWiki/Plugin/websetup.pm | 5 ++--- debian/changelog | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'IkiWiki/Plugin/websetup.pm') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 2d978c5b4..95d044c08 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -138,9 +138,8 @@ sub showfields ($$$@) { my $value=$config{$key}; - if ($info{safe} && defined $value && - (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { - $value=[@{$value}, "", ""]; # blank items for expansion + if ($info{safe} && (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { + $value=[(ref $value eq 'ARRAY' ? @{$value} : ""), "", ""]; # blank items for expansion } if ($info{type} eq "string") { diff --git a/debian/changelog b/debian/changelog index 13ceb875f..51c9617f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ ikiwiki (3.00) UNRELEASED; urgency=low * htmlbalance: Demand-load HTML::TreeBuilder to avoid failing test suite if it is not present. * French translation update from Philippe Batailler. Closes: #510216 + * websetup: Avoid a crash when a new array setup item has been added in + a new ikiwiki release, and is thus not present in the setup file yet. -- Joey Hess Wed, 24 Dec 2008 19:49:36 -0500 -- cgit v1.2.3