Skip to content
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

Escape # in filename url #721

Merged
merged 2 commits into from
Aug 29, 2018
Merged
Changes from 1 commit
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
1 change: 1 addition & 0 deletions asv/www/asv.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ $(document).ready(function() {
"LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8",
"LPT9"];
name = name.replace(bad_re, "_");
name = name.replace("#", "%23");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also take the comment above "The implementation must match asv.util.sanitize_filename" into account.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just escaping the # character. Filename is the same.

Copy link
Collaborator

@pv pv Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, possibly, this is not the right place to do the url quoting, but it should be done at the point where the json request is made.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The replacement should be done in graph_to_path, so that the comment does not become false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 7ba45ca

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, lgtm

if (bad_names.indexOf(name.toUpperCase()) != -1) {
name = name + "_";
}
Expand Down