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

Fix some 2.19 regressions and improve twitter and github spouts #1367

Merged
merged 9 commits into from
Oct 9, 2022

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Oct 9, 2022

Fix some 2.19 regressions.

@netlify
Copy link

netlify bot commented Oct 9, 2022

Deploy Preview for selfoss ready!

Name Link
🔨 Latest commit 0920dcb
🔍 Latest deploy log https://app.netlify.com/sites/selfoss/deploys/63431c28186e08000953000a
😎 Deploy Preview https://deploy-preview-1367--selfoss.netlify.app/docs/customization/api
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@jtojnar jtojnar added this to the 2.19 milestone Oct 9, 2022
@jtojnar jtojnar changed the title Random fixes Fix some 2.19 regressions and improve twitter and github spouts Oct 9, 2022
Since we ported the client to React, most of the strings are treated as plain text,
which is the default behaviour to prevent XSS and other security issues.
Search mode injects HTML markers into `title`, `content` and `sourcetitle` fields, though.
And while `title` and `content` are already HTML, so we do not need to do anything there,
`sourcetitle` is treated like a plain text so the marker HTML tags would be displayed verbatim.

Let’s strip the markers out and replace them with actual tags.

Ideally, we would just highlight on the client side to also allow searching in offline mode.
But until then this hack will have to do.
    Variable $previousUseErrors might not be defined.
URLSearchParams would just turn it to `"null"`.

Let’s use JSON so that we can go with other value types than string.
It is used by Readability library used by Graby and it will be mandatory once we update to Graby 2.0.0.
This is important when having the title auto-filled when creating the source.
Previously we would show it in the title but author field is obviously more correct.
It is supposed to be a plain text field, even though SimplePie escapes it.
We are already decoding it.

We are not updating existing fields in the database since, even though it is improbable
that a text that looks like escaped HTML would be used as an author, it cannot be fully ruled out.
If you want to do it, you can run the following SQL code:

    UPDATE items SET author = REPLACE(REPLACE(REPLACE(author, '&gt;', '>'), '&lt;', '<'), '&amp;', '&')

Fixes: #1317
This raises API version, since previously the value would be an empty string when there was no author.

Also update the database contents, replacing empty authors with `null`, so that clients can just rely on `null` author meaning ”no author”.
@jtojnar jtojnar merged commit 0920dcb into master Oct 9, 2022
@jtojnar jtojnar deleted the random-fixes branch October 9, 2022 19:12
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.

1 participant