mirror of
https://github.com/golang/go
synced 2024-11-05 14:56:10 -07:00
godoc: don't display tar instructions for malformed download query
Ensure that the filename passed via ?download= matches the given regexp before showing the command-line instructions to download it. Change-Id: Ieb7c6912409474f31637ff1193fd195eb9f172b3 Reviewed-on: https://go-review.googlesource.com/126717 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
parent
8cc4e8a6f4
commit
0700b576e4
@ -253,13 +253,13 @@ function personalizeInstallInstructions() {
|
||||
|
||||
var filename = s.substr(prefix.length);
|
||||
var filenameRE = /^go1\.\d+(\.\d+)?([a-z0-9]+)?\.([a-z0-9]+)(-[a-z0-9]+)?(-osx10\.[68])?\.([a-z.]+)$/;
|
||||
$('.downloadFilename').text(filename);
|
||||
$('.hideFromDownload').hide();
|
||||
var m = filenameRE.exec(filename);
|
||||
if (!m) {
|
||||
// Can't interpret file name; bail.
|
||||
return;
|
||||
}
|
||||
$('.downloadFilename').text(filename);
|
||||
$('.hideFromDownload').hide();
|
||||
|
||||
var os = m[3];
|
||||
var ext = m[6];
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user