Skip to content

rewrite profile page javascript to be bundled, and avoid jquery #3013

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 1 commit into from
Apr 18, 2024

Conversation

haarg
Copy link
Member

@haarg haarg commented Apr 14, 2024

No description provided.

const input = link.parentNode.previousElementSibling;
console.log(link);
console.log(input);
link.href = url.replace('%s', input.value);

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML

[DOM text](1) is reinterpreted as HTML without escaping meta-characters.
Copy link
Member

Choose a reason for hiding this comment

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

Copilot says:

link.href = url.replace('%s', encodeURIComponent(input.value));

@haarg haarg force-pushed the haarg/profile-no-jquery branch from 22f0774 to 41e881e Compare April 14, 2024 22:40
@haarg haarg force-pushed the haarg/profile-no-jquery branch from 41e881e to a7f8f89 Compare April 14, 2024 22:57
@oalders oalders requested a review from dhogan8 April 17, 2024 13:38
Copy link
Contributor

@dhogan8 dhogan8 left a comment

Choose a reason for hiding this comment

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

LGTM! Not sure if you want to address the Github check warning in root/static/js/profile.js though.

@haarg
Copy link
Member Author

haarg commented Apr 17, 2024

That warning is partly wrong, but also already applies to the existing code.

I am confident enough in the rest of our code that I don't feel the need to address it.

@oalders oalders merged commit 39f3c94 into master Apr 18, 2024
@oalders oalders deleted the haarg/profile-no-jquery branch April 18, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants