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

Update link valiation to include known protocols #109

Merged
merged 6 commits into from
Jan 26, 2023

Conversation

zkamvar
Copy link
Contributor

@zkamvar zkamvar commented Jan 26, 2023

This updates the $validate_links() method to now include an allowed list of protocols and will error if the protocol is not within the list. I have derived the list of protocols from Wordpress: https://developer.wordpress.org/reference/functions/wp_allowed_protocols/#return

Links with protocols not within our allow list will be flagged:

      link-test.md:45  [invalid protocol] (gttps) [needs HTTPS] gttps://example.com
      link-test.md:47  [invalid protocol] (bitcoin) [needs HTTPS] bitcoin:FAKE-EXAMPLE
      link-test.md:48  [invalid protocol] (javascript) [needs HTTPS] javascript:alert%28%27JavaScript%20Link!%27%29

I have also updated the error messages and documentation around link validation.

This will fix #107 and make sure that fishtree-attempt/instructor-training#5 actually throws a warning

@zkamvar zkamvar merged commit e815ea1 into main Jan 26, 2023
@zkamvar zkamvar deleted the fix-scheme-validation-107 branch January 26, 2023 18:00
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.

[validation] https scheme validation should use list of known schemes
1 participant