Merge lp:~jamesmikedupont/bugzilla/trunk into lp:bugzilla

Proposed by James Michael DuPont
Status: Needs review
Proposed branch: lp:~jamesmikedupont/bugzilla/trunk
Merge into: lp:bugzilla
Diff against target: 170 lines (+37/-18)
7 files modified
Bugzilla/Auth.pm (+2/-1)
Bugzilla/Auth/Login/Stack.pm (+16/-7)
Bugzilla/DB.pm (+9/-4)
Bugzilla/Install/Localconfig.pm (+2/-1)
Bugzilla/Template.pm (+5/-3)
Bugzilla/Util.pm (+1/-0)
collectstats.pl (+2/-2)
To merge this branch: bzr merge lp:~jamesmikedupont/bugzilla/trunk
Reviewer Review Type Date Requested Status
VCS imports Pending
Review via email: mp+130705@code.launchpad.net

Description of the change

perlcritic I/O layer ":utf8" used at line 235, column 9. Use ":encoding(UTF-8)" to get strict validation. (Severity: 5)

To post a comment you must log in.
lp:~jamesmikedupont/bugzilla/trunk updated
8446. By James Michael DuPont

experimental branch

8447. By James Michael DuPont

Use of uninitialized value $skin in string ne at bugzilla/Bugzilla/Template.pm line 476

Unmerged revisions

8447. By James Michael DuPont

Use of uninitialized value $skin in string ne at bugzilla/Bugzilla/Template.pm line 476

8446. By James Michael DuPont

experimental branch

8445. By James Michael DuPont

 perlcritic I/O layer ":utf8" used at line 235, column 9. Use ":encoding(UTF-8)" to get strict validation. (Severity: 5)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Bugzilla/Auth.pm'
2--- Bugzilla/Auth.pm 2012-09-01 21:43:00 +0000
3+++ Bugzilla/Auth.pm 2012-10-22 17:09:19 +0000
4@@ -24,11 +24,12 @@
5 use Bugzilla::Auth::Verify::Stack;
6 use Bugzilla::Auth::Persist::Cookie;
7 use Socket;
8+use Carp qw(confess);
9
10 sub new {
11 my ($class, $params) = @_;
12 my $self = fields::new($class);
13-
14+ confess "missing user_info_class" unless Bugzilla->params->{'user_info_class'};
15 $params ||= {};
16 $params->{Login} ||= Bugzilla->params->{'user_info_class'} . ',Cookie';
17 $params->{Verify} ||= Bugzilla->params->{'user_verify_class'};
18
19=== modified file 'Bugzilla/Auth/Login/Stack.pm'
20--- Bugzilla/Auth/Login/Stack.pm 2012-09-01 21:43:00 +0000
21+++ Bugzilla/Auth/Login/Stack.pm 2012-10-22 17:09:19 +0000
22@@ -23,18 +23,27 @@
23 sub new {
24 my $class = shift;
25 my $self = $class->SUPER::new(@_);
26- my $list = shift;
27- my %methods = map { $_ => "Bugzilla/Auth/Login/$_.pm" } split(',', $list);
28+ my $list = shift || die "missing the required class name parameter";
29+
30+ my %methods;
31+ for my $key (split(',', $list)) {
32+ if (defined($key)) {
33+ $methods{$key} = "Bugzilla/Auth/Login/${key}.pm";
34+ }
35+ }
36+
37 lock_keys(%methods);
38 Bugzilla::Hook::process('auth_login_methods', { modules => \%methods });
39
40 $self->{_stack} = [];
41 foreach my $login_method (split(',', $list)) {
42- my $module = $methods{$login_method};
43- require $module;
44- $module =~ s|/|::|g;
45- $module =~ s/.pm$//;
46- push(@{$self->{_stack}}, $module->new(@_));
47+ if ($login_method) {
48+ my $module = $methods{$login_method};
49+ require $module;
50+ $module =~ s|/|::|g;
51+ $module =~ s/.pm$//;
52+ push(@{$self->{_stack}}, $module->new(@_));
53+ }
54 }
55 return $self;
56 }
57
58=== modified file 'Bugzilla/DB.pm'
59--- Bugzilla/DB.pm 2012-09-01 21:43:00 +0000
60+++ Bugzilla/DB.pm 2012-10-22 17:09:19 +0000
61@@ -9,7 +9,8 @@
62
63 use 5.10.1;
64 use strict;
65-
66+use Carp qw(confess cluck);
67+use Data::Dumper;
68 use DBI;
69
70 # Inherit the DB class from DBI::db.
71@@ -113,18 +114,22 @@
72
73 sub connect_main {
74 my $lc = Bugzilla->localconfig;
75- return _connect(Bugzilla->localconfig);
76+# cluck Dumper($lc);
77+ confess "no connection config" unless keys %{$lc};
78+ return _connect($lc);
79 }
80
81 sub _connect {
82 my ($params) = @_;
83
84+ confess "missing database driver" unless exists($params->{db_driver});
85+
86 my $driver = $params->{db_driver};
87 my $pkg_module = DB_MODULE->{lc($driver)}->{db};
88-
89+
90 # do the actual import
91 eval ("require $pkg_module")
92- || die ("'$driver' is not a valid choice for \$db_driver in "
93+ || confess ("'$driver' is not a valid choice for \$db_driver in "
94 . " localconfig: " . $@);
95
96 # instantiate the correct DB specific module
97
98=== modified file 'Bugzilla/Install/Localconfig.pm'
99--- Bugzilla/Install/Localconfig.pm 2012-09-01 21:43:00 +0000
100+++ Bugzilla/Install/Localconfig.pm 2012-10-22 17:09:19 +0000
101@@ -28,6 +28,7 @@
102 use Term::ANSIColor;
103
104 use base qw(Exporter);
105+use Carp qw(confess cluck);
106
107 our @EXPORT_OK = qw(
108 read_localconfig
109@@ -106,7 +107,7 @@
110 sub read_localconfig {
111 my ($include_deprecated) = @_;
112 my $filename = bz_locations()->{'localconfig'};
113-
114+# cluck $filename;
115 my %localconfig;
116 if (-e $filename) {
117 my $s = new Safe;
118
119=== modified file 'Bugzilla/Template.pm'
120--- Bugzilla/Template.pm 2012-10-13 15:27:15 +0000
121+++ Bugzilla/Template.pm 2012-10-22 17:09:19 +0000
122@@ -472,9 +472,11 @@
123 }
124 $set{alternate} = \%skin_urls;
125
126- my $skin = $skin_user_prefs->{'value'};
127- if ($skin ne 'standard' and defined $set{alternate}->{$skin}) {
128- $set{skin} = delete $set{alternate}->{$skin};
129+ if (defined($skin_user_prefs->{'value'})) {
130+ my $skin = $skin_user_prefs->{'value'};
131+ if ($skin ne 'standard' and defined $set{alternate}->{$skin}) {
132+ $set{skin} = delete $set{alternate}->{$skin};
133+ }
134 }
135
136 my $custom_file_name = $file_name;
137
138=== modified file 'Bugzilla/Util.pm'
139--- Bugzilla/Util.pm 2012-10-16 20:57:15 +0000
140+++ Bugzilla/Util.pm 2012-10-22 17:09:19 +0000
141@@ -365,6 +365,7 @@
142
143 sub use_attachbase {
144 my $attachbase = Bugzilla->params->{'attachment_base'};
145+ return 0 unless defined $attachbase;
146 return ($attachbase ne ''
147 && $attachbase ne Bugzilla->params->{'urlbase'}
148 && $attachbase ne Bugzilla->params->{'sslbase'}) ? 1 : 0;
149
150=== modified file 'collectstats.pl'
151--- collectstats.pl 2012-10-16 18:26:54 +0000
152+++ collectstats.pl 2012-10-22 17:09:19 +0000
153@@ -172,7 +172,7 @@
154 }
155
156 if (Bugzilla->params->{'utf8'}) {
157- binmode DATA, ':utf8';
158+ binmode DATA, ':encoding(UTF-8)';
159 }
160
161 # Now collect current data.
162@@ -232,7 +232,7 @@
163 || ThrowCodeError('chart_file_open_fail', {'filename' => $file});
164
165 if (Bugzilla->params->{'utf8'}) {
166- binmode DATA, ':utf8';
167+ binmode DATA, ':encoding(UTF-8)';
168 }
169
170 my @data;

Subscribers

People subscribed via source and target branches