Item1300: Foswiki::Store::createWeb uses hash values as keys when changing WebPreferences
Priority: Normal
Current State: Closed
Released In: 1.0.4
Target Release: patch
Applies To: Engine
Component: Store
Branches:
Foswiki::Store.pm, line 1780 contains the following:
foreach my $key (%$opts) {
$text =~
s/($Foswiki::regex{setRegex}$key\s*=).*?$/$1 $opts->{$key}/gm;
}
This caused "Use of uninitialized value in concatenation (.) or string at .../lib/Foswiki/Store.pm line 1781." in my Apache log when I tried to create a web.
I think that should be
foreach my $key (keys %$opts) {
--
MichaelTempest
Elevating to urgent as this is a potential major failure for users creating webs
--
KennethLavrsen - 15 Mar 2009
Use of %$opts this way iterates the values
and the keys in the hash. Since the action of the loop is to substitute existing key values, it would require a value to have the same name as an existing Set key for this to go wrong, which is highly unlikely.
Confirmed that the code is wrong, but this is not a release blocker. Lowering to Normal.
--
CrawfordCurrie - 16 Mar 2009