Quantcast
Channel: Importing JSON feed should the content be sanitized? - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

Importing JSON feed should the content be sanitized?

$
0
0

I've been doing a lot of research and had several discussions in chat about learning to take a JSON feed and add the content to a post in WordPress.

In the past I would create a page template and through the setting's admin panel create a form field for a particular API's key and when the template was used it would call the JSON into a folder and loop through the results on a single page with links to the site it originated from. Now I would like to learn how take the JSON and add it to the database to be used in a post.

Research and discussions in chat have resulted several tutorials and Q&As on the subject such as:

Importing the data I was able to find:

However, I've always been taught when inputting data it should always be considered as bad input and should be tested and cleaned. When researching on sanitizing input I did run across:

Though I didn't really see anything discussing if JSON should be sanitized and when I was looking for a hook I didn't see anything. So this leads me to my question. When calling a JSON feed from a third party source should the JSON be sanitized before adding it to the database and if so does WordPress have a built in way to do it? When I researched sanitize JSON I didn't find anything built in WordPress that could sanitize the JSON.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images