diff options
author | David Lawrence <dlawrence@mozilla.com> | 2011-08-22 19:21:08 +0200 |
---|---|---|
committer | David Lawrence <dlawrence@mozilla.com> | 2011-08-22 19:21:08 +0200 |
commit | 9344a458c830ba066b9004c301d0fc6cabc8f229 (patch) | |
tree | ff06e420d70da1459af478c2619fb18900591d5c /Bugzilla | |
parent | f30b939630917a63bc733e3963869643eeccdc90 (diff) | |
parent | dd7eacbef2571efe55e5b18d80e93837dc6619d1 (diff) | |
download | bugzilla-9344a458c830ba066b9004c301d0fc6cabc8f229.tar.gz bugzilla-9344a458c830ba066b9004c301d0fc6cabc8f229.tar.xz |
merged with bugzilla/4.2
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Bug.pm | 6 | ||||
-rw-r--r-- | Bugzilla/DB/Oracle.pm | 27 | ||||
-rw-r--r-- | Bugzilla/Install/Localconfig.pm | 5 | ||||
-rw-r--r-- | Bugzilla/Install/Requirements.pm | 5 | ||||
-rw-r--r-- | Bugzilla/Token.pm | 10 |
5 files changed, 27 insertions, 26 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 40bf3af2e..6fdab3645 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -554,8 +554,8 @@ sub possible_duplicates { FROM bugs INNER JOIN bugs_fulltext ON bugs.bug_id = bugs_fulltext.bug_id WHERE ($where_sql) $product_sql - ORDER BY relevance DESC, bug_id DESC - LIMIT $sql_limit", {Slice=>{}}); + ORDER BY relevance DESC, bug_id DESC " . + $dbh->sql_limit($sql_limit), {Slice=>{}}); my @actual_dupe_ids; # Resolve duplicates into their ultimate target duplicates. @@ -1217,6 +1217,8 @@ sub send_changes { sub _send_bugmail { my ($params, $vars) = @_; + require Bugzilla::BugMail; + my $results = Bugzilla::BugMail::Send($params->{'id'}, $params->{'forced'}, $params); diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index 9fdacf24c..d91eb428e 100644 --- a/Bugzilla/DB/Oracle.pm +++ b/Bugzilla/DB/Oracle.pm @@ -177,7 +177,7 @@ sub sql_fulltext_search { my ($self, $column, $text, $label) = @_; $text = $self->quote($text); trick_taint($text); - return "CONTAINS($column,$text,$label)", "SCORE($label)"; + return "CONTAINS($column,$text,$label) > 0", "SCORE($label)"; } sub sql_date_format { @@ -379,20 +379,17 @@ sub adjust_statement { if ($new_sql !~ /\bWHERE\b/) { $new_sql = $new_sql." WHERE 1=1"; } - my ($before_where, $after_where) = split /\bWHERE\b/i,$new_sql; - if (defined($offset)) { - if ($new_sql =~ /(.*\s+)FROM(\s+.*)/i) { - my ($before_from,$after_from) = ($1,$2); - $before_where = "$before_from FROM ($before_from," - . " ROW_NUMBER() OVER (ORDER BY 1) R " - . " FROM $after_from ) "; - $after_where = " R BETWEEN $offset+1 AND $limit+$offset"; - } - } else { - $after_where = " rownum <=$limit AND ".$after_where; - } - - $new_sql = $before_where." WHERE ".$after_where; + my ($before_where, $after_where) = split(/\bWHERE\b/i, $new_sql, 2); + if (defined($offset)) { + my ($before_from, $after_from) = split(/\bFROM\b/i, $new_sql, 2); + $before_where = "$before_from FROM ($before_from," + . " ROW_NUMBER() OVER (ORDER BY 1) R " + . " FROM $after_from ) "; + $after_where = " R BETWEEN $offset+1 AND $limit+$offset"; + } else { + $after_where = " rownum <=$limit AND ".$after_where; + } + $new_sql = $before_where." WHERE ".$after_where; } return $new_sql; } diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index 3ce12207e..1ee7aca67 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -245,7 +245,8 @@ sub update_localconfig { # Move any custom or old variables into a separate file. if (scalar @old_vars) { my $filename_old = "$filename.old"; - open(my $old_file, ">>$filename_old") || die "$filename_old: $!"; + open(my $old_file, ">>:utf8", $filename_old) + or die "$filename_old: $!"; local $Data::Dumper::Purity = 1; foreach my $var (@old_vars) { print $old_file Data::Dumper->Dump([$localconfig->{$var}], @@ -259,7 +260,7 @@ sub update_localconfig { } # Re-write localconfig - open(my $fh, ">$filename") || die "$filename: $!"; + open(my $fh, ">:utf8", $filename) or die "$filename: $!"; foreach my $var (LOCALCONFIG_VARS) { my $name = $var->{name}; my $desc = install_string("localconfig_$name", { root => ROOT_USER }); diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 8825eb3a7..ef4bf3d22 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -717,8 +717,9 @@ sub _checking_for { # show "ok" or "not found". if (exists $params->{found}) { my $found_string; - # We do a string compare in case it's non-numeric. - if ($found and $found eq "-1") { + # We do a string compare in case it's non-numeric. We make sure + # it's not a version object as negative versions are forbidden. + if ($found && !ref($found) && $found eq '-1') { $found_string = install_string('module_not_found'); } elsif ($found) { diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index 69751e905..86220aa29 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -92,8 +92,9 @@ sub issue_new_user_account_token { } sub IssueEmailChangeToken { - my ($user, $old_email, $new_email) = @_; + my ($user, $new_email) = @_; my $email_suffix = Bugzilla->params->{'emailsuffix'}; + my $old_email = $user->login; my ($token, $token_ts) = _create_token($user->id, 'emailold', $old_email . ":" . $new_email); @@ -245,7 +246,7 @@ sub GenerateUniqueToken { $column ||= "token"; my $dbh = Bugzilla->dbh; - my $sth = $dbh->prepare("SELECT userid FROM $table WHERE $column = ?"); + my $sth = $dbh->prepare("SELECT 1 FROM $table WHERE $column = ?"); while ($duplicate) { ++$tries; @@ -447,7 +448,7 @@ Bugzilla::Token - Provides different routines to manage tokens. use Bugzilla::Token; Bugzilla::Token::issue_new_user_account_token($login_name); - Bugzilla::Token::IssueEmailChangeToken($user, $old_email, $new_email); + Bugzilla::Token::IssueEmailChangeToken($user, $new_email); Bugzilla::Token::IssuePasswordToken($user); Bugzilla::Token::DeletePasswordTokens($user_id, $reason); Bugzilla::Token::Cancel($token, $cancelaction, $vars); @@ -478,7 +479,7 @@ Bugzilla::Token - Provides different routines to manage tokens. Returns: Nothing. It throws an error if the same user made the same request in the last few minutes. -=item C<sub IssueEmailChangeToken($user, $old_email, $new_email)> +=item C<sub IssueEmailChangeToken($user, $new_email)> Description: Sends two distinct tokens per email to the old and new email addresses to confirm the email address change for the given @@ -486,7 +487,6 @@ Bugzilla::Token - Provides different routines to manage tokens. Params: $user - User object of the user requesting a new email address. - $old_email - The current (old) email address of the user. $new_email - The new email address of the user. Returns: Nothing. |