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

external links without protocol broken for works #5443

Open
RayBB opened this issue Jul 19, 2021 · 1 comment
Open

external links without protocol broken for works #5443

RayBB opened this issue Jul 19, 2021 · 1 comment
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]

Comments

@RayBB
Copy link
Collaborator

RayBB commented Jul 19, 2021

If someone adds a link that does not start with http:// or https:// to the "links" field of a work it will not be clickable.

Evidence / Screenshot (if possible)

image

csv of works with non-http links
non-http-links.csv

Relevant url?

https://openlibrary.org/books/OL31995430M/I_Am_Brown_and_Beautiful

with link www.imaginemecbp.com

Creates: https://openlibrary.org/books/OL31995430M/www.imaginemecbp.com

Steps to Reproduce

  1. Add a link with a protocol
  2. Click on said link
  • Actual: link redirects to current page
  • Expected: link goes to publisher

Proposal & Constraints

As far as I can tell, there is no way to force anchor tags to take something like "www.mysite.com" and assume it is an external link. You must prepend the protocol of http or https.

There are a few things that we can do to address this:

  • Stop new bad links from being added
    • client side js option - probably good enough but not full proof since JS can be disabled. broader opportunity here to encourage links to be added as identifiers when relevant
    • server side validation - I'm not sure what precedent we have for this but I imagine it won't be simple
  • Fix the data currently in the DB - currently about 238 books that seem to have this issue
  • if http is missing, add it at render time - probably the most hacky but easiest to do

Related files

Stakeholders

@RayBB RayBB added Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Bug Something isn't working. [managed] labels Jul 19, 2021
@LeadSongDog
Copy link

LeadSongDog commented Jul 25, 2021

@mekarpeles This begs for malicious spam. We should never transparently redirect to a user-added outside link. At the very least the patron should be made aware of which external site the link goes to.

@cdrini cdrini added Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] and removed Needs: Lead labels Jul 26, 2021
@mekarpeles mekarpeles added Priority: 3 Issues that we can consider at our leisure. [managed] Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] and removed Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] labels Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]
Projects
None yet
Development

No branches or pull requests

4 participants