Skip to content

[Static analysis] Encodes a filename before inserting it into a URL. #120123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion clang/tools/scan-build/bin/scan-build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use Term::ANSIColor qw(:constants);
use Cwd qw/ getcwd abs_path /;
use Sys::Hostname;
use Hash::Util qw(lock_keys);
use URI::Escape;

my $Prog = "scan-build";
my $BuildName;
Expand Down Expand Up @@ -820,7 +821,8 @@ ENDTEXT
}

# Emit the "View" link.
print OUT "<td><a href=\"$ReportFile#EndPath\">View Report</a></td>";
my $EncodedReport = uri_escape($ReportFile, "^A-Za-z0-9\-\._~\/");
print OUT "<td><a href=\"$EncodedReport#EndPath\">View Report</a></td>";

# Emit REPORTBUG markers.
print OUT "\n<!-- REPORTBUG id=\"$ReportFile\" -->\n";
Expand Down
Loading