From: Byron Jones Date: Mon, 16 Feb 2015 04:17:48 +0000 (+0800) Subject: Bug 651786: Modifying the default user object modifies the DEFAULT_USER constant X-Git-Tag: bugzilla-4.4.9~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fbd84bb480852e86ab2696a70c65cb3b8e74eb8;p=thirdparty%2Fbugzilla.git Bug 651786: Modifying the default user object modifies the DEFAULT_USER constant r=sgreen,a=glob --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index aa94e44a1d..5d1c42a024 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -28,7 +28,6 @@ use Bugzilla::Group; use DateTime::TimeZone; use List::Util qw(max); use Scalar::Util qw(blessed); -use Storable qw(dclone); use URI; use URI::QueryParam; @@ -123,7 +122,7 @@ sub new { my $class = ref($invocant) || $invocant; my ($param) = @_; - my $user = DEFAULT_USER; + my $user = { %{ DEFAULT_USER() } }; bless ($user, $class); return $user unless $param; @@ -141,7 +140,7 @@ sub super_user { my $class = ref($invocant) || $invocant; my ($param) = @_; - my $user = dclone(DEFAULT_USER); + my $user = { %{ DEFAULT_USER() } }; $user->{groups} = [Bugzilla::Group->get_all]; $user->{bless_groups} = [Bugzilla::Group->get_all]; bless $user, $class;