aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/websetup.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-31 00:44:54 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-31 00:44:54 -0500
commit3e8b7a6b196767d2c7d21790b6ed7c3fb5f70d31 (patch)
tree82ebef7ab97a9e9f7f614fa2d2847fdd413c925e /IkiWiki/Plugin/websetup.pm
parent0daa4eb521a32b9ed00e99a2155416a312d478de (diff)
downloadikiwiki-3e8b7a6b196767d2c7d21790b6ed7c3fb5f70d31.tar
ikiwiki-3e8b7a6b196767d2c7d21790b6ed7c3fb5f70d31.tar.gz
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.
Diffstat (limited to 'IkiWiki/Plugin/websetup.pm')
-rw-r--r--IkiWiki/Plugin/websetup.pm5
1 files changed, 2 insertions, 3 deletions
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") {