API Sanitizes Content: getHeadlines vs. getArticle

Development-related discussion, including bundled plugins
JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

API Sanitizes Content: getHeadlines vs. getArticle

Postby JustAMacUser » 23 Nov 2015, 19:39

I noticed that the API passes an article's content through sanitize() when calling getHeadlines() but not when calling getArticle(). I'm just curious what the reason for this is?

I can understand that a client might want to sanitize the content on its own, but should getArticle() also have an option (like getHeadlines() to turn it on or off?

(It's an easy enough patch, so I could do it and submit a merge request; but technically this is also pluggable since it runs through HOOK_RENDER_ARTICLE_API.)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: API Sanitizes Content: getHeadlines vs. getArticle

Postby fox » 23 Nov 2015, 20:56

you're right, i think it should sanitize content, just like headlines output. not sure why it's like that, most likely i forgot.

if you could make it work like getheadlines and submit a merge request it would be cool.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: API Sanitizes Content: getHeadlines vs. getArticle

Postby JustAMacUser » 23 Nov 2015, 20:59

K... I'll look into it later today.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests