[bugzilla-gnome-org-upstream/4.4] Bug 651786: Modifying the default user object modifies the DEFAULT_USER constant r=sgreen, a=glob
- From: Andrea Veri <av src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bugzilla-gnome-org-upstream/4.4] Bug 651786: Modifying the default user object modifies the DEFAULT_USER constant r=sgreen, a=glob
- Date: Tue, 21 Apr 2015 12:45:33 +0000 (UTC)
commit 3fbd84bb480852e86ab2696a70c65cb3b8e74eb8
Author: Byron Jones <glob mozilla com>
Date: Mon Feb 16 12:17:48 2015 +0800
Bug 651786: Modifying the default user object modifies the DEFAULT_USER constant
r=sgreen,a=glob
Bugzilla/User.pm | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index aa94e44..5d1c42a 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]