From 94ffb7a9fb63cf16805b7c627d1914b499960088 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 16 Oct 2014 18:14:49 +0200 Subject: Bug 1068494: Remove CVS/Bonsai/LXR-specific bits of Patch Viewer r=gerv a=glob --- attachment.cgi | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index 1ddb9337e..5db8f5909 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -190,20 +190,6 @@ sub validateFormat { return $format; } -# Validates context of a diff/interdiff. Will throw an error if the context -# is not number, "file" or "patch". Returns the validated, detainted context. -sub validateContext -{ - my $context = $cgi->param('context') || "patch"; - if ($context ne "file" && $context ne "patch") { - my $orig_context = $context; - detaint_natural($context) - || ThrowUserError("invalid_context", { context => $orig_context }); - } - - return $context; -} - # Gets the attachment object(s) generated by validateID, while ensuring # attachbase and token authentication is used when required. sub get_attachment { @@ -392,17 +378,15 @@ sub interdiff { $old_attachment = validateID('oldid'); $new_attachment = validateID('newid'); } - my $context = validateContext(); Bugzilla::Attachment::PatchReader::process_interdiff( - $old_attachment, $new_attachment, $format, $context); + $old_attachment, $new_attachment, $format); } sub diff { # Retrieve and validate parameters my $format = validateFormat('html', 'raw'); my $attachment = $format eq 'raw' ? get_attachment() : validateID(); - my $context = validateContext(); # If it is not a patch, view normally. if (!$attachment->ispatch) { @@ -410,7 +394,7 @@ sub diff { return; } - Bugzilla::Attachment::PatchReader::process_diff($attachment, $format, $context); + Bugzilla::Attachment::PatchReader::process_diff($attachment, $format); } # Display all attachments for a given bug in a series of IFRAMEs within one -- cgit v1.2.3-24-g4f1b