Index: buglist.cgi
===================================================================
--- buglist.cgi (wersja 600)
+++ buglist.cgi (kopia robocza)
@@ -301,9 +301,10 @@
my $dbh = Bugzilla->dbh;
$query_name = trim($query_name);
- my ($query_obj) = grep {$_->name eq $query_name} @{Bugzilla->user->queries};
+ my ($query_obj) = grep {lc($_->name) eq lc($query_name)} @{Bugzilla->user->queries};
if ($query_obj) {
+ $query_obj->set_name($query_name);
$query_obj->set_url($query);
$query_obj->set_query_type($query_type);
$query_obj->update();
@@ -665,6 +666,8 @@
DefineColumn($field->name, 'bugs.' . $field->name, $field->description);
}
+Bugzilla::Hook::process("buglist-columns", {'columns' => $columns} );
+
################################################################################
# Display Column Determination
################################################################################
Index: Bugzilla/Constants.pm
===================================================================
--- Bugzilla/Constants.pm (wersja 600)
+++ Bugzilla/Constants.pm (kopia robocza)
@@ -147,7 +147,7 @@
# CONSTANTS
#
# Bugzilla version
-use constant BUGZILLA_VERSION => "3.0.4";
+use constant BUGZILLA_VERSION => "3.0.5";
#
# ControlMap constants for group_control_map.
Index: Bugzilla/DB/Mysql.pm
===================================================================
--- Bugzilla/DB/Mysql.pm (wersja 600)
+++ Bugzilla/DB/Mysql.pm (kopia robocza)
@@ -133,7 +133,7 @@
# Add the boolean mode modifier if the search string contains
# boolean operators.
- my $mode = ($text =~ /[+-<>()~*"]/ ? "IN BOOLEAN MODE" : "");
+ my $mode = ($text =~ /[+\-<>()~*"]/ ? "IN BOOLEAN MODE" : "");
# quote the text for use in the MATCH AGAINST expression
$text = $self->quote($text);
Index: Bugzilla/Hook.pm
===================================================================
--- Bugzilla/Hook.pm (wersja 600)
+++ Bugzilla/Hook.pm (kopia robocza)
@@ -59,7 +59,7 @@
=head1 NAME
-Bugzilla::Hook - Extendible extension hooks for Bugzilla code
+Bugzilla::Hook - Extendable extension hooks for Bugzilla code
=head1 SYNOPSIS
@@ -127,8 +127,38 @@
=head1 HOOKS
-This describes what hooks exist in Bugzilla currently.
+This describes what hooks exist in Bugzilla currently. They are mostly
+in alphabetical order, but some related hooks are near each other instead
+of being alphabetical.
+=head2 buglist-columns
+
+This happens in buglist.cgi after the standard columns have been defined and
+right before the display column determination. It gives you the opportunity
+to add additional display columns.
+
+Params:
+
+=over
+
+=item C - A hashref, where the keys are unique string identifiers
+for the column being defined and the values are hashrefs with the
+following fields:
+
+=over
+
+=item C - The name of the column in the database.
+
+=item C - The title of the column as displayed to users.
+
+=back
+
+The definition is structured as:
+
+$columns->{$id} = { name => $name, title => $title };
+
+=back
+
=head2 enter_bug-entrydefaultvars
This happens right before the template is loaded on enter_bug.cgi.
@@ -190,3 +220,36 @@
database when run.
=back
+
+=head2 webservice
+
+This hook allows you to add your own modules to the WebService. (See
+L.)
+
+Params:
+
+=over
+
+=item C
+
+A hashref that you can specify the names of your modules and what Perl
+module handles the functions for that module. (This is actually sent to
+L. You can see how that's used in F.)
+
+The Perl module name must start with C
+(replace C with the name of your extension). The C
+declaration inside that module must also start with
+C in that module's code.
+
+Example:
+
+ $dispatch->{Example} = "extensions::example::lib::Example";
+
+And then you'd have a module F
+
+It's recommended that all the keys you put in C start with the
+name of your extension, so that you don't conflict with the standard Bugzilla
+WebService functions (and so that you also don't conflict with other
+plugins).
+
+=back
\ No newline at end of file
Index: Bugzilla/Install/Filesystem.pm
===================================================================
--- Bugzilla/Install/Filesystem.pm (wersja 600)
+++ Bugzilla/Install/Filesystem.pm (kopia robocza)
@@ -153,6 +153,8 @@
dirs => $ws_dir_readable },
$templatedir => { files => $ws_readable,
dirs => $ws_dir_readable },
+ $extensionsdir => { files => $ws_readable,
+ dirs => $ws_dir_readable },
images => { files => $ws_readable,
dirs => $ws_dir_readable },
css => { files => $ws_readable,
Index: Bugzilla/Install/Requirements.pm
===================================================================
--- Bugzilla/Install/Requirements.pm (wersja 600)
+++ Bugzilla/Install/Requirements.pm (kopia robocza)
@@ -91,10 +91,14 @@
version => ON_WINDOWS ? '2.16' : '2.00'
},
{
- # This will pull in Email::MIME for us, also.
+ package => 'Email-MIME',
+ module => 'Email::MIME',
+ version => '1.861'
+ },
+ {
package => 'Email-MIME-Modifier',
module => 'Email::MIME::Modifier',
- version => 0
+ version => '1.442'
},
);
Index: Bugzilla/Search/Saved.pm
===================================================================
--- Bugzilla/Search/Saved.pm (wersja 600)
+++ Bugzilla/Search/Saved.pm (kopia robocza)
@@ -55,7 +55,7 @@
link_in_footer => \&_check_link_in_footer,
};
-use constant UPDATE_COLUMNS => qw(query query_type);
+use constant UPDATE_COLUMNS => qw(name query query_type);
##############
# Validators #
@@ -79,6 +79,8 @@
$query || ThrowUserError("buglist_parameters_required");
my $cgi = new Bugzilla::CGI($query);
$cgi->clean_search_url;
+ # Don't store the query name as a parameter.
+ $cgi->delete('known_name');
return $cgi->query_string;
}
@@ -188,6 +190,7 @@
# Mutators #
############
+sub set_name { $_[0]->set('name', $_[1]); }
sub set_url { $_[0]->set('query', $_[1]); }
sub set_query_type { $_[0]->set('query_type', $_[1]); }
Index: Bugzilla/User.pm
===================================================================
--- Bugzilla/User.pm (wersja 600)
+++ Bugzilla/User.pm (kopia robocza)
@@ -682,7 +682,7 @@
}
trick_taint($product_name);
my $can_enter =
- grep($_->name eq $product_name, @{$self->get_enterable_products});
+ grep(lc($_->name) eq lc($product_name), @{$self->get_enterable_products});
return 1 if $can_enter;
@@ -2005,7 +2005,7 @@
=item C
-Returns the result of C as a string (a comma-separated
+Returns the result of C as a string (a comma-separated
list).
=item C
Index: Bugzilla/WebService/Constants.pm
===================================================================
--- Bugzilla/WebService/Constants.pm (wersja 600)
+++ Bugzilla/WebService/Constants.pm (kopia robocza)
@@ -50,6 +50,8 @@
# comment that it was retired. Also, if an error changes its name, you'll
# have to fix it here.
use constant WS_ERROR_CODE => {
+ # Generic Bugzilla::Object errors are 50-99.
+ param_required => 50,
# Bug errors usually occupy the 100-200 range.
invalid_bug_id_or_alias => 100,
invalid_bug_id_non_existent => 101,
Index: Bugzilla/WebService/User.pm
===================================================================
--- Bugzilla/WebService/User.pm (wersja 600)
+++ Bugzilla/WebService/User.pm (kopia robocza)
@@ -37,6 +37,12 @@
sub login {
my ($self, $params) = @_;
my $remember = $params->{remember};
+
+ # Username and password params are required
+ foreach my $param ("login", "password") {
+ defined $params->{$param}
+ || ThrowCodeError('param_required', { param => $param });
+ }
# Convert $remember from a boolean 0/1 value to a CGI-compatible one.
if (defined($remember)) {
@@ -180,6 +186,10 @@
The account has been disabled. A reason may be specified with the
error.
+=item 50 (Param Required)
+
+A login or password parameter was not provided.
+
=back
=back
Index: contrib/bzdbcopy.pl
===================================================================
--- contrib/bzdbcopy.pl (wersja 600)
+++ contrib/bzdbcopy.pl (kopia robocza)
@@ -48,6 +48,14 @@
. SOURCE_DB_TYPE . "...\n";
my $source_db = Bugzilla::DB::_connect(SOURCE_DB_TYPE, 'localhost',
SOURCE_DB_NAME, undef, undef, SOURCE_DB_USER, SOURCE_DB_PASSWORD);
+# Don't read entire tables into memory.
+if (SOURCE_DB_TYPE eq 'Mysql') {
+ $source_db->{'mysql_use_result'}=1;
+
+ # MySQL cannot have two queries running at the same time. Ensure the schema
+ # is loaded from the database so bz_column_info will not execute a query
+ $source_db->_bz_real_schema;
+}
print "Connecting to the '" . TARGET_DB_NAME . "' target database on "
. TARGET_DB_TYPE . "...\n";
@@ -81,7 +89,8 @@
@table_columns;
my $select_query = "SELECT " . join(',', @table_columns) . " FROM $table";
- my $data_in = $source_db->selectall_arrayref($select_query);
+ my $select_sth = $source_db->prepare($select_query);
+ $select_sth->execute();
my $insert_query = "INSERT INTO $table ( " . join(',', @table_columns)
. " ) VALUES (";
@@ -97,7 +106,7 @@
print "Writing data to the target '$table' table on "
. TARGET_DB_TYPE . "...";
- foreach my $row (@$data_in) {
+ while (my $row = $select_sth->fetchrow_arrayref) {
# Each column needs to be bound separately, because
# many columns need to be dealt with specially.
my $colnum = 0;
Index: contrib/syncLDAP.pl
===================================================================
--- contrib/syncLDAP.pl (wersja 600)
+++ contrib/syncLDAP.pl (kopia robocza)
@@ -96,12 +96,18 @@
print "No LDAP server defined in bugzilla preferences.\n";
exit;
}
-my $LDAPport = "389"; # default LDAP port
-if($LDAPserver =~ /:/) {
- ($LDAPserver, $LDAPport) = split(":",$LDAPserver);
+my $LDAPconn;
+if($LDAPserver =~ /:\/\//) {
+ # if the "LDAPserver" parameter is in uri scheme
+ $LDAPconn = Net::LDAP->new($LDAPserver, version => 3);
+} else {
+ my $LDAPport = "389"; # default LDAP port
+ if($LDAPserver =~ /:/) {
+ ($LDAPserver, $LDAPport) = split(":",$LDAPserver);
+ }
+ $LDAPconn = Net::LDAP->new($LDAPserver, port => $LDAPport, version => 3);
}
-my $LDAPconn = Net::LDAP->new($LDAPserver, port => $LDAPport, version => 3);
if(!$LDAPconn) {
print "Connecting to LDAP server failed. Check LDAPserver setting.\n";
exit;
Index: email_in.pl
===================================================================
--- email_in.pl (wersja 600)
+++ email_in.pl (kopia robocza)
@@ -330,6 +330,8 @@
$var =~ s/\>/>/g;
$var =~ s/\"/\"/g;
$var =~ s/@/@/g;
+ # Also remove undesired newlines and consecutive spaces.
+ $var =~ s/[\n\s]+/ /gms;
return $var;
}
@@ -352,10 +354,12 @@
$msg =~ s/at .+ line.*$//ms;
$msg =~ s/^Compilation failed in require.+$//ms;
$msg = html_strip($msg);
- my $reply = reply(to => $input_email, top_post => 1, body => "$msg\n");
+ my $from = Bugzilla->params->{'mailfrom'};
+ my $reply = reply(to => $input_email, from => $from, top_post => 1,
+ body => "$msg\n");
MessageToMTA($reply->as_string);
}
- print STDERR $msg;
+ print STDERR "$msg\n";
# We exit with a successful value, because we don't want the MTA
# to *also* send a failure notice.
exit;
Index: importxml.pl
===================================================================
--- importxml.pl (wersja 600)
+++ importxml.pl (kopia robocza)
@@ -379,8 +379,13 @@
elsif ($encoding =~ /filename/) {
# read the attachment file
Error("attach_path is required", undef) unless ($attach_path);
- my $attach_filename = $attach_path . "/" . $attach->field('data');
- open(ATTACH_FH, $attach_filename) or
+
+ my $filename = $attach->field('data');
+ # Remove any leading path data from the filename
+ $filename =~ s/(.*\/|.*\\)//gs;
+
+ my $attach_filename = $attach_path . "/" . $filename;
+ open(ATTACH_FH, "<", $attach_filename) or
Error("cannot open $attach_filename", undef);
$attachment{'data'} = do { local $/; };
close ATTACH_FH;
Index: mod_perl.pl
===================================================================
--- mod_perl.pl (wersja 600)
+++ mod_perl.pl (kopia robocza)
@@ -100,10 +100,12 @@
package Bugzilla::ModPerl::CleanupHandler;
use strict;
use Apache2::Const -compile => qw(OK);
+use Bugzilla;
sub handler {
my $r = shift;
-
+
+ Bugzilla::_cleanup();
# Sometimes mod_perl doesn't properly call DESTROY on all
# the objects in pnotes()
foreach my $key (keys %{$r->pnotes}) {
Index: template/en/default/admin/groups/create.html.tmpl
===================================================================
--- template/en/default/admin/groups/create.html.tmpl (wersja 600)
+++ template/en/default/admin/groups/create.html.tmpl (kopia robocza)
@@ -55,8 +55,7 @@
Name is what is used with the Bugzilla->user->in_group()
function in any customized cgi files you write that use a given group.
It can also be used by people submitting [% terms.bugs %] by email to
-limit [% terms.abug %] to a certain set of groups. It may not contain
-any spaces.
+limit [% terms.abug %] to a certain set of groups.
Description is what will be shown in the [% terms.bug %] reports
to members of the group where they can choose whether
Index: template/en/default/admin/params/ldap.html.tmpl
===================================================================
--- template/en/default/admin/params/ldap.html.tmpl (wersja 600)
+++ template/en/default/admin/params/ldap.html.tmpl (kopia robocza)
@@ -32,8 +32,8 @@
"ldapi://%2fvar%2flib%2fldap_sock (for a socket-based " _
"local connection.",
- LDAPstartls => "Whether to require encrypted communication once normal " _
- "LDAP connection achieved with the server.",
+ LDAPstarttls => "Whether to require encrypted communication once a normal " _
+ "LDAP connection is achieved with the server.",
LDAPbinddn => "If your LDAP server requires that you use a binddn and password " _
"instead of binding anonymously, enter it here " _
Index: template/en/default/bug/create/create.html.tmpl
===================================================================
--- template/en/default/bug/create/create.html.tmpl (wersja 600)
+++ template/en/default/bug/create/create.html.tmpl (kopia robocza)
@@ -401,7 +401,7 @@
[% USE Bugzilla %]
[% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1,
enter_bug => 1 }) %]
- [% SET value = ${field.name} IF ${field.name}.defined %]
+ [% SET value = ${field.name}.defined ? ${field.name} : "" %]
[% PROCESS bug/field.html.tmpl editable=1 value_span=2 %]