From 2de0a4bb2b07d3231299ef250e32c3bd7f3517b5 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 23 Apr 2005 18:48:56 +0000 Subject: [PATCH] must check that directives that have only one element are turned into arrays --- lib/WebGUI/Config.pm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/WebGUI/Config.pm b/lib/WebGUI/Config.pm index caf1af364..7a714031a 100644 --- a/lib/WebGUI/Config.pm +++ b/lib/WebGUI/Config.pm @@ -150,17 +150,10 @@ sub readConfig { foreach my $key ($config->directives) { $data{$key} = $config->get($key); } - if (ref $data{assetAddPrivilege} ne "ARRAY") { - $data{assetAddPrivilege} = [$data{assetAddPrivilege}]; - } - if (ref $data{authMethods} ne "ARRAY") { - $data{authMethods} = [$data{authMethods}]; - } - if (ref $data{wobjects} ne "ARRAY"){ - $data{wobjects} = [$data{wobjects}]; - } - if (ref $data{paymentPlugins} ne "ARRAY") { - $data{paymentPlugins} = [$data{paymentPlugins}] if ($data{paymentPlugins}); + foreach my $directive (qw(assetAddPrivilege assets utilityAssets assetContainers authMethods paymentPlugins)) { + if (ref $data{$directive} ne "ARRAY") { + $data{$directive} = [$data{$directive}]; + } } if( defined( $data{scripturl} ) ) { # get rid of leading "/" if present.