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

Various fixes #906

Merged
merged 5 commits into from
Apr 8, 2017
Merged

Various fixes #906

merged 5 commits into from
Apr 8, 2017

Conversation

niol
Copy link
Collaborator

@niol niol commented Mar 26, 2017

Various fixes detailed in the individual commits.

@@ -212,7 +212,7 @@ public function getId() {
*/
public function getTitle() {
if ($this->items !== false && $this->valid()) {
return @current($this->items)->get_title();
return htmlspecialchars_decode(@current($this->items)->get_title());
Copy link
Member

Choose a reason for hiding this comment

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

Why are you decoding the title?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because some people wanted HTML in the title to be shown.

Copy link
Member

Choose a reason for hiding this comment

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

Why is it escaped for GitHub spout then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because otherwise, a commit message containing HTML entities would mess up the selfoss stream in the client browser (or be stripped if the tag is not allowed). What we want from commit messages is the raw HTML to be shown in the browser, thus the escaping.

On the contrary, in RSS feeds, we want the HTML to format text in the client browser. Thus, it must be passed as raw HTML the the content loader, filtered by sanitize{Field,Content}() and sent the the client browser.

Copy link
Member

Choose a reason for hiding this comment

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

RSS specs suggest HTML can only appear within description element. The following feed was broken by the PR:

http://www.vzhurudolu.cz/rss

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Are you sure? From a quick test, the behavior for this feed is the same as before, which was my intention. A few years ago, some people were expecting HTML in the title. No sure what to do here.

Copy link
Member

Choose a reason for hiding this comment

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

You are right, the behaviour was the same. And apparently, Feedly and tt-rss do it too. For now we can probably leave it as is

spouts/spout.php Outdated
@@ -91,14 +91,16 @@ public function getSpoutTitle() {
abstract public function getId();

/**
* returns the current title as string
* returns the current title as string with html special chars decoded if
* applicable.
Copy link
Member

@jtojnar jtojnar Apr 4, 2017

Choose a reason for hiding this comment

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

When is it applicable?

niol added 5 commits April 8, 2017 02:23
selfoss was checking for items with the same uid in the whole items database,
not within the same source. This change searchs for items with the same uid
only in the same source.

This would have potentially allowed one feed to prevent any new items from
being loaded from another feed.
@jtojnar jtojnar merged commit 9c50c26 into fossar:master Apr 8, 2017
@niol niol deleted the ppr/fixqueue branch April 14, 2017 09:01
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.

2 participants