From 37722eca39874bb6abdcd120e3e458bd62dea62b Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 5 Jul 2017 11:43:18 -0700 Subject: Bug 1377933 - Remove trailing whitespace from all perl files --- extensions/Splinter/lib/Util.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'extensions/Splinter/lib/Util.pm') diff --git a/extensions/Splinter/lib/Util.pm b/extensions/Splinter/lib/Util.pm index a24881c1d..d85b0532b 100644 --- a/extensions/Splinter/lib/Util.pm +++ b/extensions/Splinter/lib/Util.pm @@ -53,14 +53,14 @@ use base qw(Exporter); sub attachment_id_is_valid { my ($attach_id, $dont_validate_access) = @_; - # Validate the specified attachment id. + # Validate the specified attachment id. detaint_natural($attach_id) || return 0; # Make sure the attachment exists in the database. my $attachment = new Bugzilla::Attachment({ id => $attach_id, cache => 1 }) || return 0; - return $attachment + return $attachment if ($dont_validate_access || attachment_is_visible($attachment)); } @@ -71,9 +71,9 @@ sub attachment_is_visible { $attachment->isa('Bugzilla::Attachment') || return 0; - return (Bugzilla->user->can_see_bug($attachment->bug->id) - && (!$attachment->isprivate - || Bugzilla->user->id == $attachment->attacher->id + return (Bugzilla->user->can_see_bug($attachment->bug->id) + && (!$attachment->isprivate + || Bugzilla->user->id == $attachment->attacher->id || Bugzilla->user->is_insider)); } @@ -107,7 +107,7 @@ sub get_review_link { my $attachment = attachment_id_is_valid($attach_id); if (attachment_id_is_patch($attach_id)) { - return "bug, $attach_id)) . "'>$link_text"; } else { @@ -122,7 +122,7 @@ sub munge_create_attachment { return ("$intro_text" . " View: $view_link\015\012" . " Review: " . get_review_url($bug, $attach_id, 1) . "\015\012"); - } + } else { return ("$intro_text --> ($view_link)"); } @@ -143,7 +143,7 @@ sub add_review_links_to_email { my $new_body = 0; my $bug; - if ($email->header('Subject') =~ /^\[Bug\s+(\d+)\]/ + if ($email->header('Subject') =~ /^\[Bug\s+(\d+)\]/ && Bugzilla->user->can_see_bug($1)) { $bug = Bugzilla::Bug->new({ id => $1, cache => 1 }); -- cgit v1.2.3-24-g4f1b