diff options
author | David Lawrence <dlawrence@mozilla.com> | 2011-10-05 00:43:47 +0200 |
---|---|---|
committer | David Lawrence <dlawrence@mozilla.com> | 2011-10-05 00:43:47 +0200 |
commit | befdcc8f9a30f55e91227bac0ee1813a661002b3 (patch) | |
tree | 34daa9fe986e9cc42e803f6dc8b382e2f05feb4a /extensions/Splinter/lib | |
parent | 8592e84f5d251a284f09fae2947101715e094a78 (diff) | |
download | bugzilla-befdcc8f9a30f55e91227bac0ee1813a661002b3.tar.gz bugzilla-befdcc8f9a30f55e91227bac0ee1813a661002b3.tar.xz |
more porting work
Diffstat (limited to 'extensions/Splinter/lib')
-rw-r--r-- | extensions/Splinter/lib/Util.pm | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/extensions/Splinter/lib/Util.pm b/extensions/Splinter/lib/Util.pm index 1861d7ab6..c8c0d52d2 100644 --- a/extensions/Splinter/lib/Util.pm +++ b/extensions/Splinter/lib/Util.pm @@ -21,6 +21,8 @@ package Bugzilla::Extension::Splinter::Util; +use strict; + use Bugzilla; use Bugzilla::Util; @@ -66,9 +68,9 @@ sub get_review_url { my $bug_id = $bug->id; if (defined $absolute && $absolute) { - my $urlbase = correct_urlbase(); - $urlbase =~ s!/$!! if $base =~ "^/"; - $base = $urlbase . $base; + my $urlbase = correct_urlbase(); + $urlbase =~ s!/$!! if $base =~ "^/"; + $base = $urlbase . $base; } if ($base =~ /\?/) { @@ -93,12 +95,12 @@ sub munge_create_attachment { my ($bug, $intro_text, $attach_id, $view_link) = @_; if (attachment_id_is_patch ($attach_id)) { - return ("$intro_text" . + return ("$intro_text" . " View: $view_link\015\012" . " Review: " . get_review_url($bug, $attach_id, 1) . "\015\012"); } else { - return ("$intro_text --> ($view_link)"); + return ("$intro_text --> ($view_link)"); } } @@ -115,24 +117,24 @@ sub add_review_links_to_email { if ($email->header('Subject') =~ /^\[Bug\s+(\d+)\]/ && Bugzilla->user->can_see_bug($1)) { - $bug = Bugzilla::Bug->new($1); + $bug = Bugzilla::Bug->new($1); } return unless defined $bug; if ($body =~ /Review\s+of\s+attachment\s+\d+\s*:/) { - $body =~ s~(Review\s+of\s+attachment\s+(\d+)\s*:) + $body =~ s~(Review\s+of\s+attachment\s+(\d+)\s*:) ~"$1\015\012 --> (" . get_review_url($bug, $2, 1) . ")" ~egx; - $new_body = 1; + $new_body = 1; } if ($body =~ /Created attachment \d+\015\012 --> /) { - $body =~ s~(Created\ attachment\ (\d+)\015\012) + $body =~ s~(Created\ attachment\ (\d+)\015\012) \ -->\ \(([^\015\012]*)\)[^\015\012]* ~munge_create_attachment($bug, $1, $2, $3) ~egx; - $new_body = 1; + $new_body = 1; } $email->body_set($body) if $new_body; |