From a1b036d6b115df6d7ee4ae075f3ad51a32d54efc Mon Sep 17 00:00:00 2001 From: pdontthink Date: Wed, 26 Jan 2005 20:31:42 +0000 Subject: [PATCH] Remove numeric keys from plugin array in config.php git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8708 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + config/conf.pl | 10 +++++++--- config/config_default.php | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7d0d3ec..9d78a247 100644 --- a/ChangeLog +++ b/ChangeLog @@ -191,6 +191,7 @@ Version 1.5.1 -- CVS - Security: Fix possible XSS issues in src/webmail.php. [CAN-2005-0104] - Fix undefined variables in src/webmail.php. - 24hr clock format should include a leading 0. + - Removed numeric keys for plugin array in config.php Version 1.5.0 -------------------- diff --git a/config/conf.pl b/config/conf.pl index ba63bd53..39ea11b6 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -188,11 +188,15 @@ while ( $line = ) { $sub =~ s/\]\[['"]NAME['"]\]//; $sub =~ s/.*\[//; $theme_name[$sub] = $options[1]; - } elsif ( $options[0] =~ /^plugins\[[0-9]+\]/ ) { + } elsif ( $options[0] =~ /^plugins\[[0-9]*\]/ ) { $sub = $options[0]; $sub =~ s/\]//; $sub =~ s/^plugins\[//; - $plugins[$sub] = $options[1]; + if ($sub eq '') { + push @plugins, $options[1]; + } else { + $plugins[$sub] = $options[1]; + } } elsif ( $options[0] =~ /^ldap_server\[[0-9]+\]/ ) { $sub = $options[0]; $sub =~ s/\]//; @@ -3219,7 +3223,7 @@ sub save_data { # all plugins are strings for ( $ct = 0 ; $ct <= $#plugins ; $ct++ ) { - print CF "\$plugins[$ct] = '$plugins[$ct]';\n"; + print CF "\$plugins[] = '$plugins[$ct]';\n"; } print CF "\n"; diff --git a/config/config_default.php b/config/config_default.php index e883a04c..31796f19 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -773,8 +773,8 @@ $motd = ""; * the plugin directory name relative to the /plugins/ directory. * For instance, for the 'sqclock' plugin, you'd put a line like * the following. - * $plugins[0] = 'sqclock'; - * $plugins[1] = 'attachment_common'; + * $plugins[] = 'sqclock'; + * $plugins[] = 'attachment_common'; */ // Add list of enabled plugins here @@ -969,4 +969,4 @@ $config_use_color = 2; * sent and regular output to begin, which will majorly screw * things up when we try to send more headers later. */ -?> \ No newline at end of file +?> -- 2.25.1