fix websetup display of unsafe arrays in expert mode
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 12 Feb 2010 03:55:35 +0000 (22:55 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 12 Feb 2010 03:55:35 +0000 (22:55 -0500)
IkiWiki/Plugin/websetup.pm

index e477bcc20dad42ed2f505f0936b82d93c3271ae9..76ca1c9e24c03a0e91462681b964d855433e11de 100644 (file)
@@ -138,9 +138,9 @@ sub showfields ($$$@) {
 
                my $value=$config{$key};
 
-               if ($info{safe} && (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) {
-                       $value=[(ref $value eq 'ARRAY' ? map { Encode::encode_utf8($_) }  @{$value} : ""),
-                               "", ""]; # blank items for expansion
+               if (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY') {
+                       $value=[(ref $value eq 'ARRAY' ? map { Encode::encode_utf8($_) }  @{$value} : "")];
+                       push @$value, "", "" if $info{safe}; # blank items for expansion
                }
                else {
                        $value=Encode::encode_utf8($value);