From a3841dfd8f9fc019eda1ccf57c91b7305cef1c7e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 16 Oct 2013 00:40:18 +0800 Subject: Bug 916906: attaching a file which just contains a github url should automatically redirect to it when viewing --- attachment.cgi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index 350cf91f1..95d793e75 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -52,6 +52,7 @@ use Bugzilla::Attachment; use Bugzilla::Attachment::PatchReader; use Bugzilla::Token; use Bugzilla::Keyword; +use Bugzilla::Hook; use Encode qw(encode find_encoding); @@ -386,6 +387,9 @@ sub view { # Return the appropriate HTTP response headers. $attachment->datasize || ThrowUserError("attachment_removed"); + # BMO add a hook for github url redirection + Bugzilla::Hook::process('attachment_view', { attachment => $attachment }); + $filename =~ s/^.*[\/\\]//; # escape quotes and backslashes in the filename, per RFCs 2045/822 $filename =~ s/\\/\\\\/g; # escape backslashes -- cgit v1.2.3-24-g4f1b